Skip to content

Commit 479478f

Browse files
committed
test: multi compiler mode
1 parent f57e9dc commit 479478f

File tree

2 files changed

+117
-12
lines changed

2 files changed

+117
-12
lines changed

test/e2e/__snapshots__/magic-html.test.js.snap.webpack4

+39-12
Original file line numberDiff line numberDiff line change
@@ -40,53 +40,53 @@ exports[`magicHtml option disabled filename bundle.js should not handle HEAD req
4040

4141
exports[`magicHtml option disabled filename bundle.js should not handle HEAD request to magic async html (/bundle): response text 1`] = `""`;
4242

43-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): console messages 1`] = `
43+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: console messages 1`] = `
4444
Array [
4545
"Failed to load resource: the server responded with a status of 404 (Not Found)",
4646
]
4747
`;
4848

49-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): page errors 1`] = `Array []`;
49+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: page errors 1`] = `Array []`;
5050

51-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): response headers content-type 1`] = `"text/html; charset=utf-8"`;
51+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: response headers content-type 1`] = `"text/html; charset=utf-8"`;
5252

53-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): response status 1`] = `404`;
53+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: response status 1`] = `404`;
5454

55-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): response text 1`] = `
55+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: response text 1`] = `
5656
"<!DOCTYPE html>
5757
<html lang=\\"en\\">
5858
<head>
5959
<meta charset=\\"utf-8\\">
6060
<title>Error</title>
6161
</head>
6262
<body>
63-
<pre>Cannot GET /bundle.other</pre>
63+
<pre>Cannot GET /bundle</pre>
6464
</body>
6565
</html>
6666
"
6767
`;
6868

69-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: console messages 1`] = `
69+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): console messages 1`] = `
7070
Array [
7171
"Failed to load resource: the server responded with a status of 404 (Not Found)",
7272
]
7373
`;
7474

75-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: page errors 1`] = `Array []`;
75+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): page errors 1`] = `Array []`;
7676

77-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: response headers content-type 1`] = `"text/html; charset=utf-8"`;
77+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): response headers content-type 1`] = `"text/html; charset=utf-8"`;
7878

79-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: response status 1`] = `404`;
79+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): response status 1`] = `404`;
8080

81-
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to /bundle: response text 1`] = `
81+
exports[`magicHtml option disabled filename bundle.other.js should not handle GET request to magic async html (/bundle.other): response text 1`] = `
8282
"<!DOCTYPE html>
8383
<html lang=\\"en\\">
8484
<head>
8585
<meta charset=\\"utf-8\\">
8686
<title>Error</title>
8787
</head>
8888
<body>
89-
<pre>Cannot GET /bundle</pre>
89+
<pre>Cannot GET /bundle.other</pre>
9090
</body>
9191
</html>
9292
"
@@ -185,3 +185,30 @@ exports[`magicHtml option enabled filename bundle.other.js should not handle GET
185185
</html>
186186
"
187187
`;
188+
189+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): console messages 1`] = `
190+
Array [
191+
"[HMR] Waiting for update signal from WDS...",
192+
"Hey.",
193+
"[webpack-dev-server] Hot Module Replacement enabled.",
194+
"[webpack-dev-server] Live Reloading enabled.",
195+
]
196+
`;
197+
198+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): page errors 1`] = `Array []`;
199+
200+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): response headers content-type 1`] = `"text/html; charset=utf-8"`;
201+
202+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): response status 1`] = `200`;
203+
204+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): response text 1`] = `"<!DOCTYPE html><html><head><meta charset=\\"utf-8\\"/></head><body><script type=\\"text/javascript\\" charset=\\"utf-8\\" src=\\"/main.js\\"></script></body></html>"`;
205+
206+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): console messages 1`] = `Array []`;
207+
208+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): page errors 1`] = `Array []`;
209+
210+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): response headers content-type 1`] = `"text/html; charset=utf-8"`;
211+
212+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): response status 1`] = `200`;
213+
214+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): response text 1`] = `""`;

test/e2e/__snapshots__/magic-html.test.js.snap.webpack5

+78
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,33 @@ exports[`magicHtml option enabled filename bundle.other.js should not handle GET
186186
"
187187
`;
188188

189+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): console messages 1`] = `
190+
Array [
191+
"[HMR] Waiting for update signal from WDS...",
192+
"Hey.",
193+
"[webpack-dev-server] Hot Module Replacement enabled.",
194+
"[webpack-dev-server] Live Reloading enabled.",
195+
]
196+
`;
197+
198+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): page errors 1`] = `Array []`;
199+
200+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): response headers content-type 1`] = `"text/html; charset=utf-8"`;
201+
202+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): response status 1`] = `200`;
203+
204+
exports[`magicHtml option enabled multi compiler mode should handle GET request to magic async html (/main): response text 1`] = `"<!DOCTYPE html><html><head><meta charset=\\"utf-8\\"/></head><body><script type=\\"text/javascript\\" charset=\\"utf-8\\" src=\\"/main.js\\"></script></body></html>"`;
205+
206+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): console messages 1`] = `Array []`;
207+
208+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): page errors 1`] = `Array []`;
209+
210+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): response headers content-type 1`] = `"text/html; charset=utf-8"`;
211+
212+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): response status 1`] = `200`;
213+
214+
exports[`magicHtml option enabled multi compiler mode should handle HEAD request to magic async html (/main): response text 1`] = `""`;
215+
189216
exports[`magicHtml option enabled with experiments.outputModule: false filename bundle.js should handle GET request to magic async html (/bundle): console messages 1`] = `
190217
Array [
191218
"[HMR] Waiting for update signal from WDS...",
@@ -346,6 +373,57 @@ exports[`magicHtml option enabled with experiments.outputModule: true and .js ex
346373
"
347374
`;
348375

376+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle GET request to magic async html (/bundle): console messages 1`] = `Array []`;
377+
378+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle GET request to magic async html (/bundle): page errors 1`] = `
379+
Array [
380+
[Error: SyntaxError: Cannot use 'import.meta' outside a module],
381+
]
382+
`;
383+
384+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle GET request to magic async html (/bundle): response headers content-type 1`] = `"text/html; charset=utf-8"`;
385+
386+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle GET request to magic async html (/bundle): response status 1`] = `200`;
387+
388+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle GET request to magic async html (/bundle): response text 1`] = `"<!DOCTYPE html><html><head><meta charset=\\"utf-8\\"/></head><body><script type=\\"text/javascript\\" charset=\\"utf-8\\" src=\\"/bundle.js\\"></script></body></html>"`;
389+
390+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle HEAD request to magic async html (/bundle): console messages 1`] = `Array []`;
391+
392+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle HEAD request to magic async html (/bundle): page errors 1`] = `Array []`;
393+
394+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle HEAD request to magic async html (/bundle): response headers content-type 1`] = `"text/html; charset=utf-8"`;
395+
396+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle HEAD request to magic async html (/bundle): response status 1`] = `200`;
397+
398+
exports[`magicHtml option enabled with experiments.outputModule: true and .js extension multi compiler mode should handle HEAD request to magic async html (/bundle): response text 1`] = `""`;
399+
400+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle GET request to magic async html (/main): console messages 1`] = `
401+
Array [
402+
"[HMR] Waiting for update signal from WDS...",
403+
"Hey.",
404+
"[webpack-dev-server] Hot Module Replacement enabled.",
405+
"[webpack-dev-server] Live Reloading enabled.",
406+
]
407+
`;
408+
409+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle GET request to magic async html (/main): page errors 1`] = `Array []`;
410+
411+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle GET request to magic async html (/main): response headers content-type 1`] = `"text/html; charset=utf-8"`;
412+
413+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle GET request to magic async html (/main): response status 1`] = `200`;
414+
415+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle GET request to magic async html (/main): response text 1`] = `"<!DOCTYPE html><html><head><meta charset=\\"utf-8\\"/></head><body><script type=\\"module\\" charset=\\"utf-8\\" src=\\"/main.mjs\\"></script></body></html>"`;
416+
417+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle HEAD request to magic async html (/main): console messages 1`] = `Array []`;
418+
419+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle HEAD request to magic async html (/main): page errors 1`] = `Array []`;
420+
421+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle HEAD request to magic async html (/main): response headers content-type 1`] = `"text/html; charset=utf-8"`;
422+
423+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle HEAD request to magic async html (/main): response status 1`] = `200`;
424+
425+
exports[`magicHtml option enabled with experiments.outputModule: true in multi compiler mode should handle HEAD request to magic async html (/main): response text 1`] = `""`;
426+
349427
exports[`magicHtml option enabled with experiments.outputModule: true should handle GET request to magic async html (/main): console messages 1`] = `
350428
Array [
351429
"[HMR] Waiting for update signal from WDS...",

0 commit comments

Comments
 (0)