Skip to content

Commit

Permalink
perf(tests): run e2e tests in band
Browse files Browse the repository at this point in the history
  • Loading branch information
huafu committed Sep 1, 2018
1 parent 090ca7b commit b3e94ff
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions e2e/__helpers__/test-case/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ export function run(name: string, options: RunTestOptions = {}): RunResult {
}

// run in band
if (!cmdArgs.includes('--runInBand')) {
cmdArgs.push('--runInBand')
}
// if (!cmdArgs.includes('--runInBand')) {
// cmdArgs.push('--runInBand')
// }

const cmd = cmdArgs.shift() as string

Expand Down
10 changes: 5 additions & 5 deletions e2e/__tests__/__snapshots__/hoisting.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`Hoisting jest.mock() & jest.unmock() should pass using template "defaul
`;
exports[`Hoisting jest.mock() & jest.unmock() should pass using template "default": output 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand Down Expand Up @@ -142,7 +142,7 @@ exports[`Hoisting jest.mock() & jest.unmock() should pass using template "with-b
`;
exports[`Hoisting jest.mock() & jest.unmock() should pass using template "with-babel-6": output 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand Down Expand Up @@ -234,7 +234,7 @@ exports[`Hoisting jest.mock() & jest.unmock() should pass using template "with-b
`;
exports[`Hoisting jest.mock() & jest.unmock() should pass using template "with-babel-7": output 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand Down Expand Up @@ -313,7 +313,7 @@ exports[`Hoisting jest.mock() & jest.unmock() should pass using template "with-j
`;
exports[`Hoisting jest.mock() & jest.unmock() should pass using template "with-jest-22": output 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand Down Expand Up @@ -392,7 +392,7 @@ exports[`Hoisting jest.mock() & jest.unmock() should pass using template "with-t
`;
exports[`Hoisting jest.mock() & jest.unmock() should pass using template "with-typescript-2-7": output 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/logger.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Array [
`;
exports[`With unsupported version test should pass using template "with-unsupported-version" 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand Down
10 changes: 5 additions & 5 deletions e2e/__tests__/__snapshots__/simple.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Simple test should pass using template "default" 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand All @@ -19,7 +19,7 @@ exports[`Simple test should pass using template "default" 1`] = `
`;

exports[`Simple test should pass using template "with-babel-6" 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand All @@ -37,7 +37,7 @@ exports[`Simple test should pass using template "with-babel-6" 1`] = `
`;

exports[`Simple test should pass using template "with-babel-7" 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand All @@ -55,7 +55,7 @@ exports[`Simple test should pass using template "with-babel-7" 1`] = `
`;

exports[`Simple test should pass using template "with-jest-22" 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand All @@ -73,7 +73,7 @@ exports[`Simple test should pass using template "with-jest-22" 1`] = `
`;

exports[`Simple test should pass using template "with-typescript-2-7" 1`] = `
√ jest --runInBand
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand Down
10 changes: 5 additions & 5 deletions e2e/__tests__/__snapshots__/source-map.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports[`using template "default" should have the source mpas comment 1`] = `
`;
exports[`using template "default" should report correct line numbers 1`] = `
× jest --runInBand
× jest
↳ exit code: 1
===[ STDOUT ]===================================================================
console.log main.ts:2
Expand Down Expand Up @@ -123,7 +123,7 @@ exports[`using template "with-babel-6" should have the source mpas comment 1`] =
`;
exports[`using template "with-babel-6" should report correct line numbers 1`] = `
× jest --runInBand
× jest
↳ exit code: 1
===[ STDOUT ]===================================================================
console.log main.ts:2
Expand Down Expand Up @@ -217,7 +217,7 @@ exports[`using template "with-babel-7" should have the source mpas comment 1`] =
`;
exports[`using template "with-babel-7" should report correct line numbers 1`] = `
× jest --runInBand
× jest
↳ exit code: 1
===[ STDOUT ]===================================================================
console.log main.ts:2
Expand Down Expand Up @@ -305,7 +305,7 @@ exports[`using template "with-jest-22" should have the source mpas comment 1`] =
`;
exports[`using template "with-jest-22" should report correct line numbers 1`] = `
× jest --runInBand
× jest
↳ exit code: 1
===[ STDOUT ]===================================================================
console.log main.ts:2
Expand Down Expand Up @@ -391,7 +391,7 @@ exports[`using template "with-typescript-2-7" should have the source mpas commen
`;
exports[`using template "with-typescript-2-7" should report correct line numbers 1`] = `
× jest --runInBand
× jest
↳ exit code: 1
===[ STDOUT ]===================================================================
console.log main.ts:2
Expand Down
20 changes: 10 additions & 10 deletions e2e/__tests__/__snapshots__/type-checking.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`With type checking should fail using template "default" 1`] = `
× jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"typeCheck":true}}} --runInBand
× jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"typeCheck":true}}}
↳ exit code: 1
===[ STDOUT ]===================================================================
Expand All @@ -24,7 +24,7 @@ exports[`With type checking should fail using template "default" 1`] = `
`;

exports[`With type checking should fail using template "with-babel-6" 1`] = `
× jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"babelConfig":true,"typeCheck":true}}} --runInBand
× jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"babelConfig":true,"typeCheck":true}}}
↳ exit code: 1
===[ STDOUT ]===================================================================
Expand All @@ -47,7 +47,7 @@ exports[`With type checking should fail using template "with-babel-6" 1`] = `
`;

exports[`With type checking should fail using template "with-babel-7" 1`] = `
× jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"babelConfig":true,"typeCheck":true}}} --runInBand
× jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"babelConfig":true,"typeCheck":true}}}
↳ exit code: 1
===[ STDOUT ]===================================================================
Expand All @@ -70,7 +70,7 @@ exports[`With type checking should fail using template "with-babel-7" 1`] = `
`;

exports[`With type checking should fail using template "with-jest-22" 1`] = `
× jest --config {"transform":{"^.+\\\\.tsx?$":"ts-jest"},"testMatch":["**/__tests__/**/*.js?(x)","**/?(*.)+(spec|test).js?(x)","**/__tests__/**/*.ts?(x)","**/?(*.)+(spec|test).ts?(x)"],"moduleFileExtensions":["js","json","jsx","node","ts","tsx"],"testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"typeCheck":true}}} --runInBand
× jest --config {"transform":{"^.+\\\\.tsx?$":"ts-jest"},"testMatch":["**/__tests__/**/*.js?(x)","**/?(*.)+(spec|test).js?(x)","**/__tests__/**/*.ts?(x)","**/?(*.)+(spec|test).ts?(x)"],"moduleFileExtensions":["js","json","jsx","node","ts","tsx"],"testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"typeCheck":true}}}
↳ exit code: 1
===[ STDOUT ]===================================================================
Expand All @@ -93,7 +93,7 @@ exports[`With type checking should fail using template "with-jest-22" 1`] = `
`;

exports[`With type checking should fail using template "with-typescript-2-7" 1`] = `
× jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"diagnostics":{"ignoreCodes":[5023]},"typeCheck":true}}} --runInBand
× jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"diagnostics":{"ignoreCodes":[5023]},"typeCheck":true}}}
↳ exit code: 1
===[ STDOUT ]===================================================================
Expand All @@ -116,7 +116,7 @@ exports[`With type checking should fail using template "with-typescript-2-7" 1`]
`;

exports[`Without type checking should pass using template "default" 1`] = `
√ jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"typeCheck":false}}} --runInBand
√ jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"typeCheck":false}}}
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand All @@ -133,7 +133,7 @@ exports[`Without type checking should pass using template "default" 1`] = `
`;

exports[`Without type checking should pass using template "with-babel-6" 1`] = `
√ jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"babelConfig":true,"typeCheck":false}}} --runInBand
√ jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"babelConfig":true,"typeCheck":false}}}
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand All @@ -150,7 +150,7 @@ exports[`Without type checking should pass using template "with-babel-6" 1`] = `
`;

exports[`Without type checking should pass using template "with-babel-7" 1`] = `
√ jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"babelConfig":true,"typeCheck":false}}} --runInBand
√ jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"babelConfig":true,"typeCheck":false}}}
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand All @@ -167,7 +167,7 @@ exports[`Without type checking should pass using template "with-babel-7" 1`] = `
`;

exports[`Without type checking should pass using template "with-jest-22" 1`] = `
√ jest --config {"transform":{"^.+\\\\.tsx?$":"ts-jest"},"testMatch":["**/__tests__/**/*.js?(x)","**/?(*.)+(spec|test).js?(x)","**/__tests__/**/*.ts?(x)","**/?(*.)+(spec|test).ts?(x)"],"moduleFileExtensions":["js","json","jsx","node","ts","tsx"],"testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"typeCheck":false}}} --runInBand
√ jest --config {"transform":{"^.+\\\\.tsx?$":"ts-jest"},"testMatch":["**/__tests__/**/*.js?(x)","**/?(*.)+(spec|test).js?(x)","**/__tests__/**/*.ts?(x)","**/?(*.)+(spec|test).ts?(x)"],"moduleFileExtensions":["js","json","jsx","node","ts","tsx"],"testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"typeCheck":false}}}
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand All @@ -184,7 +184,7 @@ exports[`Without type checking should pass using template "with-jest-22" 1`] = `
`;

exports[`Without type checking should pass using template "with-typescript-2-7" 1`] = `
√ jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"diagnostics":{"ignoreCodes":[5023]},"typeCheck":false}}} --runInBand
√ jest --config {"preset":"ts-jest","testEnvironment":"node","globals":{"ts-jest":{"tsConfig":{},"diagnostics":{"ignoreCodes":[5023]},"typeCheck":false}}}
↳ exit code: 0
===[ STDOUT ]===================================================================
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (parentArgs.includes('--coverage')) {
)
parentArgs = parentArgs.filter(a => a !== '--coverage')
}
if (!parentArgs.includes('--runInBand')) parentArgs.push('--runInBand')
// if (!parentArgs.includes('--runInBand')) parentArgs.push('--runInBand')

function getDirectories(rootDir) {
return fs.readdirSync(rootDir).filter(function(file) {
Expand Down

0 comments on commit b3e94ff

Please sign in to comment.