diff --git a/.eslintignore b/.eslintignore index 010eb91b941..5a5046b3bd8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,5 @@ **/__testfixtures__/* coverage test -docs \ No newline at end of file +docs +node_modules \ No newline at end of file diff --git a/test/BinTestCases.test.js b/test/BinTestCases.test.js index a7b2c1d5242..8763fdb91c7 100644 --- a/test/BinTestCases.test.js +++ b/test/BinTestCases.test.js @@ -167,8 +167,8 @@ describe("BinTestCases", function() { try { testAssertions(env.code, stdout, stderr); } catch(e) { - console.log(`### stderr ###\n${env.stderr.join("")}`); - console.log(`### stdout ###\n${env.stdout.join("")}`); + // console.log(`### stderr ###\n${env.stderr.join("")}`); + // console.log(`### stdout ###\n${env.stdout.join("")}`); throw e; } }); diff --git a/test/binCases/config-name/found-many/stdin.js b/test/binCases/config-name/found-many/stdin.js index 92101fe6e75..f2470ab62f3 100644 --- a/test/binCases/config-name/found-many/stdin.js +++ b/test/binCases/config-name/found-many/stdin.js @@ -3,7 +3,7 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); - expect(stdout[9]).toContain("./index2.js"); - expect(stdout[17]).toContain("./index3.js"); + expect(stdout[8]).toContain("./index2.js"); + expect(stdout[15]).toContain("./index3.js"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/config-name/found-one/stdin.js b/test/binCases/config-name/found-one/stdin.js index 05f976aea03..ff94f80eabf 100644 --- a/test/binCases/config-name/found-one/stdin.js +++ b/test/binCases/config-name/found-one/stdin.js @@ -3,7 +3,6 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); - - expect(stdout[7]).toContain("./index2.js"); + expect(stdout[6]).toContain("./index2.js"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/config-type/array/stdin.js b/test/binCases/config-type/array/stdin.js index 37b57fac4ae..bc6021dc769 100644 --- a/test/binCases/config-type/array/stdin.js +++ b/test/binCases/config-type/array/stdin.js @@ -7,7 +7,7 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(stdout[1]).toContain("Version: "); expect(stdout[2]).toContain("Child"); expect(stdout[7]).toContain("entry-a.bundle.js"); - expect(stdout[10]).toContain("Child"); - expect(stdout[15]).toContain("entry-b.bundle.js"); + expect(stdout[9]).toContain("Child"); + expect(stdout[14]).toContain("entry-b.bundle.js"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/configFile/plugins-precedence/stdin.js b/test/binCases/configFile/plugins-precedence/stdin.js index c068bcc1464..7c3f0254c1e 100644 --- a/test/binCases/configFile/plugins-precedence/stdin.js +++ b/test/binCases/configFile/plugins-precedence/stdin.js @@ -3,6 +3,6 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); - expect(stdout[7]).toContain("ok.js"); + expect(stdout[6]).toContain("ok.js"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/configFile/profile/stdin.js b/test/binCases/configFile/profile/stdin.js index 39d46bb07aa..9dcbc695e93 100644 --- a/test/binCases/configFile/profile/stdin.js +++ b/test/binCases/configFile/profile/stdin.js @@ -4,8 +4,8 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); - expect(stdout[8]).toContain("factory:"); - expect(stdout[10]).toContain("factory:"); - expect(stdout[12]).toContain("factory:"); + expect(stdout[7]).toContain("factory:"); + expect(stdout[9]).toContain("factory:"); + expect(stdout[11]).toContain("factory:"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/entry/cli-override/stdin.js b/test/binCases/entry/cli-override/stdin.js index 20469780027..5719a57d43b 100644 --- a/test/binCases/entry/cli-override/stdin.js +++ b/test/binCases/entry/cli-override/stdin.js @@ -4,6 +4,6 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); expect(stdout[5]).toContain("cliEntry.js"); - expect(stdout[7]).toContain("index.js"); + expect(stdout[6]).toContain("index.js"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/entry/multi-file/stdin.js b/test/binCases/entry/multi-file/stdin.js index 1353cfcaf43..ac691c352f8 100644 --- a/test/binCases/entry/multi-file/stdin.js +++ b/test/binCases/entry/multi-file/stdin.js @@ -4,8 +4,8 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); expect(stdout[5]).toContain("null.js"); - expect(stdout[7]).toMatch(/a\.js.*\{0\}/); - expect(stdout[8]).toMatch(/index\.js.*\{0\}/); - expect(stdout[9]).toMatch(/multi.*index\.js.*a\.js/); // should have multi-file entry + expect(stdout[6]).toMatch(/a\.js.*\{0\}/); + expect(stdout[7]).toMatch(/index\.js.*\{0\}/); + expect(stdout[8]).toMatch(/multi.*index\.js.*a\.js/); // should have multi-file entry expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/entry/named-entry/stdin.js b/test/binCases/entry/named-entry/stdin.js index c9fce1444ac..d95bfe65527 100644 --- a/test/binCases/entry/named-entry/stdin.js +++ b/test/binCases/entry/named-entry/stdin.js @@ -4,8 +4,8 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); expect(stdout[5]).toContain("null.js"); - expect(stdout[7]).toContain("foo.js"); // named entry from --entry foo=./a.js - expect(stdout[9]).toMatch(/index\.js.*\{0\}/); - expect(stdout[10]).toMatch(/a\.js.*\{1\}/); + expect(stdout[6]).toContain("foo.js"); // named entry from --entry foo=./a.js + expect(stdout[7]).toMatch(/index\.js.*\{0\}/); + expect(stdout[8]).toMatch(/a\.js.*\{1\}/); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/entry/non-hyphenated-args/stdin.js b/test/binCases/entry/non-hyphenated-args/stdin.js index ab7cbd7e881..8942910ed51 100644 --- a/test/binCases/entry/non-hyphenated-args/stdin.js +++ b/test/binCases/entry/non-hyphenated-args/stdin.js @@ -4,6 +4,6 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); expect(stdout[5]).toContain("main.js"); // non-hyphenated arg ./a.js should create chunk "main" - expect(stdout[7]).toMatch(/a\.js.*\{0\}/); // a.js should be in chunk 0 + expect(stdout[6]).toMatch(/a\.js.*\{0\}/); // a.js should be in chunk 0 expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/env/complex/stdin.js b/test/binCases/env/complex/stdin.js index 212d1c91774..07d044d1f33 100644 --- a/test/binCases/env/complex/stdin.js +++ b/test/binCases/env/complex/stdin.js @@ -12,7 +12,7 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(stdout[9]).toContain("\"baz\": true"); expect(stdout[10]).toContain("}"); expect(stdout[12]).toContain("null.js"); - expect(stdout[14]).toContain("./index.js"); - expect(stdout[14]).toContain("[built]"); + expect(stdout[13]).toContain("./index.js"); + expect(stdout[13]).toContain("[built]"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/env/string/stdin.js b/test/binCases/env/string/stdin.js index 59c88390c5f..cd5582336a5 100644 --- a/test/binCases/env/string/stdin.js +++ b/test/binCases/env/string/stdin.js @@ -7,6 +7,6 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(stdout[1]).toContain("Version: "); expect(stdout[2]).toContain("Time: "); expect(stdout[4]).toContain("Environment (--env): \"foo\""); - expect(stdout[7]).toContain("null.js"); + expect(stdout[6]).toContain("null.js"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/errors/issue-5576/stdin.js b/test/binCases/errors/issue-5576/stdin.js index 0e6d89366ea..0bcff311595 100644 --- a/test/binCases/errors/issue-5576/stdin.js +++ b/test/binCases/errors/issue-5576/stdin.js @@ -5,7 +5,7 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(stdout[0]).toContain("Hash: "); expect(stdout[1]).toContain("Version: "); expect(stdout[2]).toContain("Time: "); - expect(stdout[6]).toContain("bundle.js"); + expect(stdout[5]).toContain("bundle.js"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/errors/parse/stdin.js b/test/binCases/errors/parse/stdin.js index 1c5c713ae6b..158648c5e46 100644 --- a/test/binCases/errors/parse/stdin.js +++ b/test/binCases/errors/parse/stdin.js @@ -5,12 +5,12 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(stdout[0]).toContain("Hash: "); expect(stdout[1]).toContain("Version: "); expect(stdout[2]).toContain("Time: "); - expect(stdout[6]).toContain("./index.js"); - expect(stdout[6]).toContain("[built]"); - expect(stdout[6]).toContain("[failed]"); - expect(stdout[6]).toContain("[1 error]"); - expect(stdout[8]).toContain("ERROR in ./index.js"); - expect(stdout[9]).toContain("Module parse failed:"); + expect(stdout[5]).toContain("./index.js"); + expect(stdout[5]).toContain("[built]"); + expect(stdout[5]).toContain("[failed]"); + expect(stdout[5]).toContain("[1 error]"); + expect(stdout[7]).toContain("ERROR in ./index.js"); + expect(stdout[8]).toContain("Module parse failed:"); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/mode/none/stdin.js b/test/binCases/mode/none/stdin.js index 5f0abbea8c5..716eda90392 100644 --- a/test/binCases/mode/none/stdin.js +++ b/test/binCases/mode/none/stdin.js @@ -4,6 +4,6 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); expect(stdout[5]).toContain("main.js"); - expect(stdout[7]).toMatch(/index\.js.*\{0\}/); + expect(stdout[6]).toMatch(/index\.js.*\{0\}/); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/output/output-argument/stdin.js b/test/binCases/output/output-argument/stdin.js index b862191c563..eba394eb76b 100644 --- a/test/binCases/output/output-argument/stdin.js +++ b/test/binCases/output/output-argument/stdin.js @@ -4,6 +4,6 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(code).toBe(0); expect(stdout).toEqual(expect.anything()); expect(stdout[5]).toContain("bundle.js"); - expect(stdout[7]).toMatch(/index\.js.*\{0\}/); + expect(stdout[6]).toMatch(/index\.js.*\{0\}/); expect(stderr).toHaveLength(0); }; diff --git a/test/binCases/stats/single-config/stdin.js b/test/binCases/stats/single-config/stdin.js index 5395e9fceb6..4cacf527879 100644 --- a/test/binCases/stats/single-config/stdin.js +++ b/test/binCases/stats/single-config/stdin.js @@ -7,7 +7,7 @@ module.exports = function testAssertions(code, stdout, stderr) { expect(stdout[1]).toContain("Version: "); expect(stdout[2]).toContain("Time: "); expect(stdout[5]).toContain("\u001b[1m\u001b[32mnull.js\u001b[39m\u001b[22m"); - expect(stdout[7]).toContain("chunk"); + expect(stdout[6]).toContain("chunk"); expect(stdout[7]).not.toContain("./index.js"); expect(stdout[7]).not.toContain("[built]"); expect(stdout[8]).toContain("1 module");