Skip to content

Commit

Permalink
test(client): add full progress snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
knagaitsev committed Jun 13, 2019
1 parent 40fac45 commit 279077f
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/e2e/Progress.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ describe('client progress', () => {
'body { background-color: rgb(255, 0, 0); }'
);
page.waitFor(10000).then(() => {
const testExp = /\[WDS\] [0-9]{1,3}% - compiling\./;
const match = res.find((line) => {
return testExp.test(line);
browser.close().then(() => {
expect(res).toMatchSnapshot();
done();
});
// eslint-disable-next-line no-undefined
expect(match).not.toEqual(undefined);
browser.close().then(done);
});
});
Expand Down
98 changes: 98 additions & 0 deletions test/e2e/__snapshots__/Progress.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`client progress using hot on browser client should console.log progress 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"[WDS] Hot Module Replacement enabled.",
"[WDS] Live Reloading enabled.",
"[WDS] App updated. Recompiling...",
"[WDS] 0% - compiling.",
"[WDS] 10% - building (0/0 modules).",
"[WDS] 10% - building (0/0 modules).",
"[WDS] 10% - building (0/1 modules).",
"[WDS] 40% - building (0/1 modules).",
"[WDS] 40% - building (1/1 modules).",
"[WDS] 70% - building (1/1 modules).",
"[WDS] 70% - finish module graph.",
"[WDS] 70% - finish module graph (FlagDependencyExportsPlugin).",
"[WDS] 70% - sealing.",
"[WDS] 70% - sealing (WarnCaseSensitiveModulesPlugin).",
"[WDS] 71% - basic dependencies optimization.",
"[WDS] 72% - dependencies optimization.",
"[WDS] 72% - advanced dependencies optimization.",
"[WDS] 73% - after dependencies optimization.",
"[WDS] 70% - chunk graph.",
"[WDS] 71% - after chunk graph.",
"[WDS] 71% - after chunk graph (WebAssemblyModulesPlugin).",
"[WDS] 73% - optimizing.",
"[WDS] 74% - basic module optimization.",
"[WDS] 74% - module optimization.",
"[WDS] 75% - advanced module optimization.",
"[WDS] 75% - after module optimization.",
"[WDS] 76% - basic chunk optimization.",
"[WDS] 76% - basic chunk optimization (EnsureChunkConditionsPlugin).",
"[WDS] 76% - basic chunk optimization (RemoveParentModulesPlugin).",
"[WDS] 76% - basic chunk optimization (RemoveEmptyChunksPlugin).",
"[WDS] 76% - basic chunk optimization (MergeDuplicateChunksPlugin).",
"[WDS] 76% - chunk optimization.",
"[WDS] 77% - advanced chunk optimization.",
"[WDS] 77% - advanced chunk optimization (SplitChunksPlugin).",
"[WDS] 77% - advanced chunk optimization (RemoveEmptyChunksPlugin).",
"[WDS] 77% - after chunk optimization.",
"[WDS] 78% - module and chunk tree optimization.",
"[WDS] 78% - after module and chunk tree optimization.",
"[WDS] 79% - basic chunk modules optimization.",
"[WDS] 79% - chunk modules optimization.",
"[WDS] 80% - advanced chunk modules optimization.",
"[WDS] 80% - after chunk modules optimization.",
"[WDS] 81% - module reviving.",
"[WDS] 81% - module reviving (RecordIdsPlugin).",
"[WDS] 81% - module order optimization.",
"[WDS] 82% - advanced module order optimization.",
"[WDS] 82% - before module ids.",
"[WDS] 82% - before module ids (NamedModulesPlugin).",
"[WDS] 83% - module ids.",
"[WDS] 83% - module id optimization.",
"[WDS] 84% - module id optimization.",
"[WDS] 84% - chunk reviving.",
"[WDS] 84% - chunk reviving (RecordIdsPlugin).",
"[WDS] 85% - chunk order optimization.",
"[WDS] 85% - chunk order optimization (OccurrenceOrderChunkIdsPlugin).",
"[WDS] 85% - before chunk ids.",
"[WDS] 85% - before chunk ids (NamedChunksPlugin).",
"[WDS] 86% - chunk id optimization.",
"[WDS] 86% - after chunk id optimization.",
"[WDS] 87% - record modules.",
"[WDS] 87% - record modules (RecordIdsPlugin).",
"[WDS] 87% - record chunks.",
"[WDS] 87% - record chunks (RecordIdsPlugin).",
"[WDS] 88% - hashing.",
"[WDS] 88% - content hashing.",
"[WDS] 88% - content hashing (JavascriptModulesPlugin).",
"[WDS] 89% - after hashing.",
"[WDS] 89% - after hashing (HotModuleReplacementPlugin).",
"[WDS] 89% - record hash.",
"[WDS] 90% - module assets processing.",
"[WDS] 90% - chunk assets processing.",
"[WDS] 91% - additional chunk assets processing.",
"[WDS] 91% - additional chunk assets processing (HotModuleReplacementPlugin).",
"[WDS] 91% - recording.",
"[WDS] 91% - recording (HotModuleReplacementPlugin).",
"[WDS] 92% - additional asset processing.",
"[WDS] 92% - chunk asset optimization.",
"[WDS] 93% - after chunk asset optimization.",
"[WDS] 93% - asset optimization.",
"[WDS] 94% - after asset optimization.",
"[WDS] 94% - after seal.",
"[WDS] 95% - emitting.",
"[WDS] 98% - after emitting.",
"[WDS] 100% - Compilation completed.",
"[WDS] App hot update...",
"[HMR] Checking for updates on the server...",
"[HMR] Updated modules:",
"[HMR] - ./main.css",
"[HMR] - ../../../node_modules/css-loader/dist/cjs.js!./main.css",
"",
"[HMR] App is up to date.",
]
`;

0 comments on commit 279077f

Please sign in to comment.