Skip to content

Commit 3e06e8d

Browse files
committed
test(client): reg exp progress test
1 parent 0832100 commit 3e06e8d

File tree

3 files changed

+9
-101
lines changed

3 files changed

+9
-101
lines changed

lib/options.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@
425425
"pfx": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserverpfx)",
426426
"pfxPassphrase": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserverpfxpassphrase)",
427427
"port": "should be {Number|String|Null} (https://webpack.js.org/configuration/dev-server/#devserverport)",
428-
"profile": "should be {Boolean}",
428+
"profile": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverprofile)",
429429
"progress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverprogress---cli-only)",
430430
"proxy": "should be {Object|Array} (https://webpack.js.org/configuration/dev-server/#devserverproxy)",
431431
"public": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserverpublic)",

test/e2e/Progress.test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,16 @@ describe('client progress', () => {
4848
);
4949
page.waitFor(10000).then(() => {
5050
browser.close().then(() => {
51-
expect(res).toMatchSnapshot();
51+
// example output that would match:
52+
// "[WDS] 40% - building (0/1 modules)."
53+
const testExp = /\[WDS\] [0-9]{1,3}% - building \([0-1]\/1 modules\)\./;
54+
const match = res.find((line) => {
55+
return testExp.test(line);
56+
});
57+
// eslint-disable-next-line no-undefined
58+
expect(match).not.toEqual(undefined);
5259
done();
5360
});
54-
browser.close().then(done);
5561
});
5662
});
5763

test/e2e/__snapshots__/Progress.test.js.snap

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)