-
Notifications
You must be signed in to change notification settings - Fork 983
chore: update karma-webpack to v5.0.1, adapt tests #4648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update karma-webpack to v5.0.1, adapt tests #4648
Conversation
… env parsing into browser/node specific code
64bc9ce to
d6b2439
Compare
|
Well that's no fun. Looks like |
Actually it looks like this is working, I asked @dyladan to run it on his mac and it works there. I'll wait for #4649 until marking this as ready for review 🙂 |
| }); | ||
|
|
||
| if (typeof process === 'undefined') { | ||
| if (global.process?.versions?.node === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed so that we mock the right thing for the right platform, process is now defined due to the required polyfill, so we're using process?.versions?.node instead to determine if we're running in Node.js or the browser.
Tests passed for me locally on macOS using Node.js v20.12.2. |
* chore(deps): update dependency karma-webpack to v5 * feat: add polyfills missing from webpack 5, adapt tests, split up raw env parsing into browser/node specific code --------- Co-authored-by: Mend Renovate <[email protected]>
Which problem is this PR solving?
We've been using
karma-webpack@4which is not compatible withwebpack@5that we were using since #4340Since webpack 5, node polyfills are not automatically included anymore, so we have to add polyfills manually.
Using an old verison of
karma-webpackwith a new version ofwebpackmay be is what's causing test failures in #4622, as one can't access any other entrypoint than@opentelemetry/apiNotable changes:
assertin our tests, so I included theassertpolyfillassertpolyfill needs theutilpolyfill, so I included thatutilpolyfill needs aprocesspolyfill, so I included that tooRequires #4649
Supersedes #4647, tests fail as no polyfills are added.
Enables #4622, where we can't import
@opentelemetry/api/experimentalin browser tests unless we updatekarma-webpackType of change