[browser tests] update Puppeteer #12222
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
The version of Puppeteer (and few related dependencies) we had is quite old and uses a version of Chromium that does not support some of the DOM API functions we use in the current code base. e.g. HTMLElement.replaceChildren() [1], that we use in hover-service.ts
The latest version seems to work well, and supports the example above, so I went with that. Note that Puppeteer now bundles its typing file, and that some of the APIs have changed slightly, requiring a small adaptation on our end.
[1]: https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren#browser_compatibility
How to test
yarn && yarn download:plugins && yarn browser build && yarn browser test
note: for the code coverage, source-map is not currently configured, so the results will be against the browser app "compiled .js files", not the original Theia sources. Anyway, the immediate goal is just to confirm that the code coverage infrastructure still works after the update.
Review checklist
Reminder for reviewers