Skip to content

Commit 33fedcc

Browse files
committed
test: add tests for plugin support
Add e2e coverage for the plugin API (api-plugin.test.js), MultiCompiler and multiple independent plugin servers, build-mode behavior, and related logging snapshots. Add the compile helper and port mappings used by these tests.
1 parent a09e00a commit 33fedcc

6 files changed

Lines changed: 704 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
exports[`API (plugin) > MultiCompiler > should work with plugin API 1`] = `
2+
[
3+
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
4+
"[HMR] Waiting for update signal from WDS...",
5+
"one",
6+
]
7+
`;
8+
9+
exports[`API (plugin) > MultiCompiler > should work with plugin API 2`] = `
10+
[]
11+
`;
12+
13+
exports[`API (plugin) > plugin in webpack config > should work when added to webpack config plugins array 1`] = `
14+
[
15+
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
16+
"[HMR] Waiting for update signal from WDS...",
17+
"Hey.",
18+
]
19+
`;
20+
21+
exports[`API (plugin) > plugin in webpack config > should work when added to webpack config plugins array 2`] = `
22+
[]
23+
`;
24+
25+
exports[`API (plugin) > plugin in webpack config > should work with output.clean: true 1`] = `
26+
[
27+
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
28+
"[HMR] Waiting for update signal from WDS...",
29+
"Hey.",
30+
]
31+
`;
32+
33+
exports[`API (plugin) > plugin in webpack config > should work with output.clean: true 2`] = `
34+
[]
35+
`;
36+
37+
exports[`API (plugin) > should work with plugin API 1`] = `
38+
[
39+
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
40+
"[HMR] Waiting for update signal from WDS...",
41+
"Hey.",
42+
]
43+
`;
44+
45+
exports[`API (plugin) > should work with plugin API 2`] = `
46+
[]
47+
`;

test/e2e/__snapshots__/logging.test.js.snap.webpack5

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
1+
exports[`logging > plugin mode > should work and do not log messages about hot and live reloading is enabled 1`] = `
2+
[
3+
"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay enabled.",
4+
"Hey.",
5+
]
6+
`;
7+
8+
exports[`logging > plugin mode > should work and log errors by default 1`] = `
9+
[
10+
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
11+
"[HMR] Waiting for update signal from WDS...",
12+
"Hey.",
13+
"[webpack-dev-server] Errors while compiling. Reload prevented.",
14+
"[webpack-dev-server] ERROR
15+
Error from compilation",
16+
]
17+
`;
18+
19+
exports[`logging > plugin mode > should work and log message about live reloading is enabled 1`] = `
20+
[
21+
"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
22+
"Hey.",
23+
]
24+
`;
25+
26+
exports[`logging > plugin mode > should work and log messages about hot and live reloading is enabled 1`] = `
27+
[
28+
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
29+
"[HMR] Waiting for update signal from WDS...",
30+
"Hey.",
31+
]
32+
`;
33+
34+
exports[`logging > plugin mode > should work and log warnings by default 1`] = `
35+
[
36+
"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
37+
"[HMR] Waiting for update signal from WDS...",
38+
"Hey.",
39+
"[webpack-dev-server] Warnings while compiling.",
40+
"[webpack-dev-server] WARNING
41+
Warning from compilation",
42+
]
43+
`;
44+
45+
exports[`logging > plugin mode > should work when the "client.logging" is "none" 1`] = `
46+
[
47+
"Hey.",
48+
]
49+
`;
50+
151
exports[`logging > should work and do not log messages about hot and live reloading is enabled (ws) 1`] = `
252
[
353
"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay enabled.",

0 commit comments

Comments
 (0)