test: add coverage for external script in EnvironmentNotSupportAsyncW…#20525
Conversation
|
Merging this PR will degrade performance by 23.04%
Performance Changes
Comparing |
|
@alexander-akait can u please take a look ! I will group my next two open PR test nwjs test and CSS moduler as one and and create them as a single PR |
|
globalThis is not supported by Node@10, you filter this test for Node@10 using |
d8c611d to
510abf0
Compare
|
@alexander-akait can u please take a look ! I will group my next two open PR test nwjs test and CSS moduler as one and and create them as a single PR
Updated added supportsGlobalThis to test.filter.js so the test is skipped on Node@10. |
|
@alexander-akait can u please have a look thanks |
|
This PR is packaged and the instant preview is available (59bf024). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@59bf024
yarn add -D webpack@https://pkg.pr.new/webpack@59bf024
pnpm add -D webpack@https://pkg.pr.new/webpack@59bf024 |
Summary
EnvironmentNotSupportAsyncWarninghas 6 code paths that emit the warning (one perFeaturetype), but the existing integration test inasync-module/environment-not-support-async-warningonly covered 5 of them —"external script"was missing.This PR adds coverage for the
"external script"code path by:"external-script"to theexternalsconfig (script scriptGlobal@https://example.com/script.js)reexport.jsglobalThis.scriptGlobalbefore the dynamic import inindex.js(needed because script externals resolve via a global variable in Node.js)warnings.jsAll 6
Featurevariants are now covered in a single test:topLevelAwait,external import,external module,external promise,external script,asyncWebAssemblyWhat kind of change does this PR introduce?
test
Did you add tests for your changes?
This PR is the test itself.
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
No documentation needed.