Skip to content

Commit

Permalink
tests: open and serve (#2275)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Dec 29, 2020
1 parent bb16d44 commit 92826d6
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 110 deletions.
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -74,7 +74,7 @@
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"execa": "^4.1.0",
"execa": "^5.0.0",
"get-port": "^5.1.1",
"git-cz": "^4.7.1",
"husky": "^4.3.0",
Expand All @@ -91,8 +91,8 @@
"ts-jest": "^26.4.3",
"typescript": "^3.9.7",
"webpack": "^5.11.0",
"webpack-bundle-analyzer": "^3.9.0",
"webpack-dev-server": "^3.11.0",
"webpack-bundle-analyzer": "^4.3.0",
"webpack-dev-server": "^3.11.1",
"yeoman-test": "^2.7.0"
}
}
2 changes: 1 addition & 1 deletion packages/utils/package.json
Expand Up @@ -13,7 +13,7 @@
],
"dependencies": {
"colorette": "^1.2.1",
"execa": "^4.1.0",
"execa": "^5.0.0",
"findup-sync": "^4.0.0",
"global-modules": "^2.0.0",
"got": "^11.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cli/package.json
Expand Up @@ -33,7 +33,7 @@
"colorette": "^1.2.1",
"commander": "^6.2.0",
"enquirer": "^2.3.6",
"execa": "^4.1.0",
"execa": "^5.0.0",
"fastest-levenshtein": "^1.0.12",
"import-local": "^3.0.2",
"interpret": "^2.2.0",
Expand Down
8 changes: 8 additions & 0 deletions test/serve/basic/serve-basic.test.js
Expand Up @@ -141,6 +141,14 @@ describe('basic serve usage', () => {
expect(stdout.match(/HotModuleReplacementPlugin/g)).toHaveLength(1);
});

it.only('should work with the "--open" option', async () => {
const { stdout, stderr } = await runServe(['--open', '--port', port], testPath);

expect(stderr).toBeFalsy();
expect(stdout).toContain('main.js');
expect(stdout.match(/HotModuleReplacementPlugin/g)).toBeNull();
});

it('should log and error on unknown flag', async () => {
const { exitCode, stdout, stderr } = await runServe(['--port', port, '--unknown-flag'], testPath);

Expand Down

0 comments on commit 92826d6

Please sign in to comment.