Skip to content

Commit 279077f

Browse files
committed
test(client): add full progress snapshot
1 parent 40fac45 commit 279077f

File tree

2 files changed

+101
-5
lines changed

2 files changed

+101
-5
lines changed

test/e2e/Progress.test.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ describe('client progress', () => {
4747
'body { background-color: rgb(255, 0, 0); }'
4848
);
4949
page.waitFor(10000).then(() => {
50-
const testExp = /\[WDS\] [0-9]{1,3}% - compiling\./;
51-
const match = res.find((line) => {
52-
return testExp.test(line);
50+
browser.close().then(() => {
51+
expect(res).toMatchSnapshot();
52+
done();
5353
});
54-
// eslint-disable-next-line no-undefined
55-
expect(match).not.toEqual(undefined);
5654
browser.close().then(done);
5755
});
5856
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`client progress using hot on browser client should console.log progress 1`] = `
4+
Array [
5+
"[HMR] Waiting for update signal from WDS...",
6+
"[WDS] Hot Module Replacement enabled.",
7+
"[WDS] Live Reloading enabled.",
8+
"[WDS] App updated. Recompiling...",
9+
"[WDS] 0% - compiling.",
10+
"[WDS] 10% - building (0/0 modules).",
11+
"[WDS] 10% - building (0/0 modules).",
12+
"[WDS] 10% - building (0/1 modules).",
13+
"[WDS] 40% - building (0/1 modules).",
14+
"[WDS] 40% - building (1/1 modules).",
15+
"[WDS] 70% - building (1/1 modules).",
16+
"[WDS] 70% - finish module graph.",
17+
"[WDS] 70% - finish module graph (FlagDependencyExportsPlugin).",
18+
"[WDS] 70% - sealing.",
19+
"[WDS] 70% - sealing (WarnCaseSensitiveModulesPlugin).",
20+
"[WDS] 71% - basic dependencies optimization.",
21+
"[WDS] 72% - dependencies optimization.",
22+
"[WDS] 72% - advanced dependencies optimization.",
23+
"[WDS] 73% - after dependencies optimization.",
24+
"[WDS] 70% - chunk graph.",
25+
"[WDS] 71% - after chunk graph.",
26+
"[WDS] 71% - after chunk graph (WebAssemblyModulesPlugin).",
27+
"[WDS] 73% - optimizing.",
28+
"[WDS] 74% - basic module optimization.",
29+
"[WDS] 74% - module optimization.",
30+
"[WDS] 75% - advanced module optimization.",
31+
"[WDS] 75% - after module optimization.",
32+
"[WDS] 76% - basic chunk optimization.",
33+
"[WDS] 76% - basic chunk optimization (EnsureChunkConditionsPlugin).",
34+
"[WDS] 76% - basic chunk optimization (RemoveParentModulesPlugin).",
35+
"[WDS] 76% - basic chunk optimization (RemoveEmptyChunksPlugin).",
36+
"[WDS] 76% - basic chunk optimization (MergeDuplicateChunksPlugin).",
37+
"[WDS] 76% - chunk optimization.",
38+
"[WDS] 77% - advanced chunk optimization.",
39+
"[WDS] 77% - advanced chunk optimization (SplitChunksPlugin).",
40+
"[WDS] 77% - advanced chunk optimization (RemoveEmptyChunksPlugin).",
41+
"[WDS] 77% - after chunk optimization.",
42+
"[WDS] 78% - module and chunk tree optimization.",
43+
"[WDS] 78% - after module and chunk tree optimization.",
44+
"[WDS] 79% - basic chunk modules optimization.",
45+
"[WDS] 79% - chunk modules optimization.",
46+
"[WDS] 80% - advanced chunk modules optimization.",
47+
"[WDS] 80% - after chunk modules optimization.",
48+
"[WDS] 81% - module reviving.",
49+
"[WDS] 81% - module reviving (RecordIdsPlugin).",
50+
"[WDS] 81% - module order optimization.",
51+
"[WDS] 82% - advanced module order optimization.",
52+
"[WDS] 82% - before module ids.",
53+
"[WDS] 82% - before module ids (NamedModulesPlugin).",
54+
"[WDS] 83% - module ids.",
55+
"[WDS] 83% - module id optimization.",
56+
"[WDS] 84% - module id optimization.",
57+
"[WDS] 84% - chunk reviving.",
58+
"[WDS] 84% - chunk reviving (RecordIdsPlugin).",
59+
"[WDS] 85% - chunk order optimization.",
60+
"[WDS] 85% - chunk order optimization (OccurrenceOrderChunkIdsPlugin).",
61+
"[WDS] 85% - before chunk ids.",
62+
"[WDS] 85% - before chunk ids (NamedChunksPlugin).",
63+
"[WDS] 86% - chunk id optimization.",
64+
"[WDS] 86% - after chunk id optimization.",
65+
"[WDS] 87% - record modules.",
66+
"[WDS] 87% - record modules (RecordIdsPlugin).",
67+
"[WDS] 87% - record chunks.",
68+
"[WDS] 87% - record chunks (RecordIdsPlugin).",
69+
"[WDS] 88% - hashing.",
70+
"[WDS] 88% - content hashing.",
71+
"[WDS] 88% - content hashing (JavascriptModulesPlugin).",
72+
"[WDS] 89% - after hashing.",
73+
"[WDS] 89% - after hashing (HotModuleReplacementPlugin).",
74+
"[WDS] 89% - record hash.",
75+
"[WDS] 90% - module assets processing.",
76+
"[WDS] 90% - chunk assets processing.",
77+
"[WDS] 91% - additional chunk assets processing.",
78+
"[WDS] 91% - additional chunk assets processing (HotModuleReplacementPlugin).",
79+
"[WDS] 91% - recording.",
80+
"[WDS] 91% - recording (HotModuleReplacementPlugin).",
81+
"[WDS] 92% - additional asset processing.",
82+
"[WDS] 92% - chunk asset optimization.",
83+
"[WDS] 93% - after chunk asset optimization.",
84+
"[WDS] 93% - asset optimization.",
85+
"[WDS] 94% - after asset optimization.",
86+
"[WDS] 94% - after seal.",
87+
"[WDS] 95% - emitting.",
88+
"[WDS] 98% - after emitting.",
89+
"[WDS] 100% - Compilation completed.",
90+
"[WDS] App hot update...",
91+
"[HMR] Checking for updates on the server...",
92+
"[HMR] Updated modules:",
93+
"[HMR] - ./main.css",
94+
"[HMR] - ../../../node_modules/css-loader/dist/cjs.js!./main.css",
95+
"",
96+
"[HMR] App is up to date.",
97+
]
98+
`;

0 commit comments

Comments
 (0)