Skip to content

Commit

Permalink
test(client): reg exp progress test
Browse files Browse the repository at this point in the history
  • Loading branch information
knagaitsev committed Jun 14, 2019
1 parent 0832100 commit 3e06e8d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 101 deletions.
2 changes: 1 addition & 1 deletion lib/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@
"pfx": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserverpfx)",
"pfxPassphrase": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserverpfxpassphrase)",
"port": "should be {Number|String|Null} (https://webpack.js.org/configuration/dev-server/#devserverport)",
"profile": "should be {Boolean}",
"profile": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverprofile)",
"progress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverprogress---cli-only)",
"proxy": "should be {Object|Array} (https://webpack.js.org/configuration/dev-server/#devserverproxy)",
"public": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserverpublic)",
Expand Down
10 changes: 8 additions & 2 deletions test/e2e/Progress.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ describe('client progress', () => {
);
page.waitFor(10000).then(() => {
browser.close().then(() => {
expect(res).toMatchSnapshot();
// example output that would match:
// "[WDS] 40% - building (0/1 modules)."
const testExp = /\[WDS\] [0-9]{1,3}% - building \([0-1]\/1 modules\)\./;
const match = res.find((line) => {
return testExp.test(line);
});
// eslint-disable-next-line no-undefined
expect(match).not.toEqual(undefined);
done();
});
browser.close().then(done);
});
});

Expand Down
98 changes: 0 additions & 98 deletions test/e2e/__snapshots__/Progress.test.js.snap

This file was deleted.

0 comments on commit 3e06e8d

Please sign in to comment.