Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(no-options): add no options test #285

Merged
merged 2 commits into from
Mar 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/binCases/config-name/found-many/test.opts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
--output-chunk-filename [id].chunk.js
--target async-node
--mode production

2 changes: 1 addition & 1 deletion test/binCases/config-type/function-promise/test.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--config ./webpack.config.js
--target async-node
--mode production
--mode production
2 changes: 1 addition & 1 deletion test/binCases/config-type/function/test.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--config ./webpack.config.js
--target async-node
--mode production
--mode production
2 changes: 1 addition & 1 deletion test/binCases/config-type/invalid-array/test.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--config ./webpack.config.js
--target async-node
--mode production
--mode production
2 changes: 1 addition & 1 deletion test/binCases/config-type/invalid-type/test.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--config ./webpack.config.js
--target async-node
--mode production
--mode production
2 changes: 1 addition & 1 deletion test/binCases/config-type/object/test.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--config ./webpack.config.js
--target async-node
--mode production
--mode production
2 changes: 1 addition & 1 deletion test/binCases/config-type/promise/test.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--config ./webpack.config.js
--target async-node
--mode production
--mode production
13 changes: 13 additions & 0 deletions test/binCases/no-options/development/stdin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use strict";

module.exports = function testAssertions(code, stdout, stderr) {
expect(code).toBe(2);
expect(stdout).toEqual(expect.anything());
expect(stdout[0]).toContain("Hash: ");
expect(stdout[1]).toContain("Version: ");
expect(stdout[2]).toContain("Time: ");
expect(stdout[4]).toContain("");
expect(stdout[5]).toContain("ERROR in Entry module not found");
expect(stdout[6]).toContain("");
expect(stderr).toHaveLength(0);
};
1 change: 1 addition & 0 deletions test/binCases/no-options/development/tests.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--mode development
1 change: 1 addition & 0 deletions test/binCases/no-options/development/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
15 changes: 15 additions & 0 deletions test/binCases/no-options/none/stdin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use strict";

module.exports = function testAssertions(code, stdout, stderr) {
expect(code).toBe(2);
expect(stdout).toEqual(expect.anything());
expect(stdout[0]).toContain("Hash: ");
expect(stdout[1]).toContain("Version: ");
expect(stdout[2]).toContain("Time: ");
expect(stdout[4]).toContain("");
expect(stdout[5]).toContain("WARNING");
expect(stdout[6]).toContain("The \'mode\' option has not been set");
expect(stdout[7]).toContain("");
expect(stdout[8]).toContain("ERROR in Entry module not found");
expect(stderr).toHaveLength(0);
};
Empty file.
13 changes: 13 additions & 0 deletions test/binCases/no-options/production/stdin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use strict";

module.exports = function testAssertions(code, stdout, stderr) {
expect(code).toBe(2);
expect(stdout).toEqual(expect.anything());
expect(stdout[0]).toContain("Hash: ");
expect(stdout[1]).toContain("Version: ");
expect(stdout[2]).toContain("Time: ");
expect(stdout[4]).toContain("");
expect(stdout[5]).toContain("ERROR in Entry module not found");
expect(stdout[6]).toContain("");
expect(stderr).toHaveLength(0);
};
1 change: 1 addition & 0 deletions test/binCases/no-options/production/tests.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--mode production
1 change: 1 addition & 0 deletions test/binCases/no-options/production/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};