From 803b7069e65c113510b6c5507d901140d35bd57a Mon Sep 17 00:00:00 2001 From: M4rk9696 Date: Tue, 20 Aug 2019 01:19:17 +0530 Subject: [PATCH 01/11] feat: Allow transforming jest-runner --- e2e/__tests__/transform.test.ts | 11 +++ .../transform-runner/__tests__/add.test.js | 10 +++ .../transform-runner/babel.config.js | 18 +++++ e2e/transform/transform-runner/package.json | 11 +++ e2e/transform/transform-runner/runner.ts | 79 +++++++++++++++++++ e2e/transform/transform-runner/tsconfig.json | 6 ++ packages/jest-core/src/TestScheduler.ts | 6 +- .../src/__tests__/TestScheduler.test.js | 18 +++-- 8 files changed, 152 insertions(+), 7 deletions(-) create mode 100644 e2e/transform/transform-runner/__tests__/add.test.js create mode 100644 e2e/transform/transform-runner/babel.config.js create mode 100644 e2e/transform/transform-runner/package.json create mode 100644 e2e/transform/transform-runner/runner.ts create mode 100644 e2e/transform/transform-runner/tsconfig.json diff --git a/e2e/__tests__/transform.test.ts b/e2e/__tests__/transform.test.ts index be5b7bf2735c..956a258b4d2d 100644 --- a/e2e/__tests__/transform.test.ts +++ b/e2e/__tests__/transform.test.ts @@ -216,3 +216,14 @@ describe('transform-environment', () => { expect(json.numPassedTests).toBe(1); }); }); + +describe('transform-runner', () => { + const dir = path.resolve(__dirname, '../transform/transform-runner'); + + it('should transform runner', () => { + const {json, stderr} = runWithJson(dir, ['--no-cache']); + expect(stderr).toMatch(/PASS/); + expect(json.success).toBe(true); + expect(json.numPassedTests).toBe(1); + }); +}); diff --git a/e2e/transform/transform-runner/__tests__/add.test.js b/e2e/transform/transform-runner/__tests__/add.test.js new file mode 100644 index 000000000000..10dca79b8672 --- /dev/null +++ b/e2e/transform/transform-runner/__tests__/add.test.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +it('should add two numbers', () => { + expect(1 + 1).toBe(2); +}); diff --git a/e2e/transform/transform-runner/babel.config.js b/e2e/transform/transform-runner/babel.config.js new file mode 100644 index 000000000000..5e1e38eebb8d --- /dev/null +++ b/e2e/transform/transform-runner/babel.config.js @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +module.exports = { + presets: [ + ['@babel/preset-typescript'], + [ + '@babel/preset-env', + { + targets: {node: 6}, + }, + ], + ], +}; diff --git a/e2e/transform/transform-runner/package.json b/e2e/transform/transform-runner/package.json new file mode 100644 index 000000000000..8ca15ecc190e --- /dev/null +++ b/e2e/transform/transform-runner/package.json @@ -0,0 +1,11 @@ +{ + "jest": { + "rootDir": "./", + "runner": "/runner.ts" + }, + "dependencies": { + "@babel/preset-env": "^7.0.0", + "@babel/preset-typescript": "^7.0.0", + "jest-environment-node": "^24.9.0" + } +} diff --git a/e2e/transform/transform-runner/runner.ts b/e2e/transform/transform-runner/runner.ts new file mode 100644 index 000000000000..62d6b5443f71 --- /dev/null +++ b/e2e/transform/transform-runner/runner.ts @@ -0,0 +1,79 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {Config} from '@jest/types'; +import { + OnTestFailure, + OnTestStart, + OnTestSuccess, + Test, + TestRunnerContext, + TestWatcher, +} from 'jest-runner'; +import throat from 'throat'; +import {TestResult} from '@jest/test-result'; + +export default class BaseTestRunner { + private _globalConfig: Config.GlobalConfig; + private _context: TestRunnerContext; + + constructor(globalConfig: Config.GlobalConfig, context?: TestRunnerContext) { + this._globalConfig = globalConfig; + this._context = context || {}; + } + + async runTests( + tests: Array, + watcher: TestWatcher, + onStart: OnTestStart, + onResult: OnTestSuccess, + onFailure: OnTestFailure + ): Promise { + const mutex = throat(1); + return tests.reduce( + (promise, test) => + mutex(() => + promise + .then(async () => { + await onStart(test); + return { + numFailingTests: 0, + numPassingTests: 1, + numPendingTests: 0, + numTodoTests: 0, + perfStats: { + end: 0, + start: 0, + }, + snapshot: { + added: 0, + fileDeleted: false, + matched: 0, + unchecked: 0, + unmatched: 0, + updated: 0, + }, + testFilePath: test.path, + testResults: [ + { + ancestorTitles: [], + duration: 2, + failureMessages: [], + fullName: 'sample test', + status: 'passed', + title: 'sample test', + }, + ], + } as TestResult; + }) + .then(result => onResult(test, result)) + .catch(err => onFailure(test, err)) + ), + Promise.resolve() + ); + } +} diff --git a/e2e/transform/transform-runner/tsconfig.json b/e2e/transform/transform-runner/tsconfig.json new file mode 100644 index 000000000000..174da5dc37bf --- /dev/null +++ b/e2e/transform/transform-runner/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "module": "commonjs", + } +} diff --git a/packages/jest-core/src/TestScheduler.ts b/packages/jest-core/src/TestScheduler.ts index 79fad4c133c4..4324d79e93f8 100644 --- a/packages/jest-core/src/TestScheduler.ts +++ b/packages/jest-core/src/TestScheduler.ts @@ -25,6 +25,7 @@ import { buildFailureTestResult, makeEmptyAggregatedTestResult, } from '@jest/test-result'; +import {ScriptTransformer} from '@jest/transform'; import type {Config} from '@jest/types'; import {formatExecError} from 'jest-message-util'; import TestRunner = require('jest-runner'); @@ -193,7 +194,10 @@ export default class TestScheduler { contexts.forEach(context => { const {config} = context; if (!testRunners[config.runner]) { - const Runner: typeof TestRunner = require(config.runner); + const transformer = new ScriptTransformer(config); + const Runner: typeof TestRunner = interopRequireDefault( + transformer.requireAndTranspileModule(config.runner) + ).default; const runner = new Runner(this._globalConfig, { changedFiles: this._context?.changedFiles, sourcesRelatedToTestsInChangedFiles: this._context diff --git a/packages/jest-core/src/__tests__/TestScheduler.test.js b/packages/jest-core/src/__tests__/TestScheduler.test.js index dc3f8d357201..4ccd1899388f 100644 --- a/packages/jest-core/src/__tests__/TestScheduler.test.js +++ b/packages/jest-core/src/__tests__/TestScheduler.test.js @@ -89,7 +89,8 @@ test('schedule tests run in parallel per default', async () => { context: { config: makeProjectConfig({ runner: 'jest-runner-parallel', - }), + transform: [], + }, hasteFS: { matchFiles: jest.fn(() => []), }, @@ -110,7 +111,8 @@ test('schedule tests run in serial if the runner flags them', async () => { context: { config: makeProjectConfig({ runner: 'jest-runner-serial', - }), + transform: [], + }, hasteFS: { matchFiles: jest.fn(() => []), }, @@ -132,7 +134,8 @@ test('should bail after `n` failures', async () => { config: makeProjectConfig({ rootDir: './', runner: 'jest-runner-serial', - }), + transform: [], + }, hasteFS: { matchFiles: jest.fn(() => []), }, @@ -162,7 +165,8 @@ test('should not bail if less than `n` failures', async () => { config: makeProjectConfig({ rootDir: './', runner: 'jest-runner-serial', - }), + transform: [], + }, hasteFS: { matchFiles: jest.fn(() => []), }, @@ -191,7 +195,8 @@ test('should set runInBand to run in serial', async () => { context: { config: makeProjectConfig({ runner: 'jest-runner-parallel', - }), + transform: [], + }, hasteFS: { matchFiles: jest.fn(() => []), }, @@ -215,7 +220,8 @@ test('should set runInBand to not run in serial', async () => { context: { config: makeProjectConfig({ runner: 'jest-runner-parallel', - }), + transform: [], + }, hasteFS: { matchFiles: jest.fn(() => []), }, From dd0181d756f5a6c56275b2e0cd86ba42d2982008 Mon Sep 17 00:00:00 2001 From: M4rk9696 Date: Thu, 29 Aug 2019 23:55:19 +0530 Subject: [PATCH 02/11] Replace test result with util --- e2e/transform/transform-runner/runner.ts | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/e2e/transform/transform-runner/runner.ts b/e2e/transform/transform-runner/runner.ts index 62d6b5443f71..16f83d3d6761 100644 --- a/e2e/transform/transform-runner/runner.ts +++ b/e2e/transform/transform-runner/runner.ts @@ -15,7 +15,7 @@ import { TestWatcher, } from 'jest-runner'; import throat from 'throat'; -import {TestResult} from '@jest/test-result'; +import {TestResult, createEmptyTestResult} from '@jest/test-result'; export default class BaseTestRunner { private _globalConfig: Config.GlobalConfig; @@ -38,25 +38,11 @@ export default class BaseTestRunner { (promise, test) => mutex(() => promise - .then(async () => { + .then(async () : Promise => { await onStart(test); return { - numFailingTests: 0, + ...createEmptyTestResult(), numPassingTests: 1, - numPendingTests: 0, - numTodoTests: 0, - perfStats: { - end: 0, - start: 0, - }, - snapshot: { - added: 0, - fileDeleted: false, - matched: 0, - unchecked: 0, - unmatched: 0, - updated: 0, - }, testFilePath: test.path, testResults: [ { @@ -64,11 +50,13 @@ export default class BaseTestRunner { duration: 2, failureMessages: [], fullName: 'sample test', + location: null, + numPassingAsserts: 1, status: 'passed', title: 'sample test', }, ], - } as TestResult; + }; }) .then(result => onResult(test, result)) .catch(err => onFailure(test, err)) From 9fd4432a369b332b9fd79367386dfc50d9233d79 Mon Sep 17 00:00:00 2001 From: M4rk9696 Date: Fri, 30 Aug 2019 00:13:36 +0530 Subject: [PATCH 03/11] Fix linting --- e2e/transform/transform-runner/runner.ts | 44 +++++++++++++----------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/e2e/transform/transform-runner/runner.ts b/e2e/transform/transform-runner/runner.ts index 16f83d3d6761..ca625c070950 100644 --- a/e2e/transform/transform-runner/runner.ts +++ b/e2e/transform/transform-runner/runner.ts @@ -38,30 +38,32 @@ export default class BaseTestRunner { (promise, test) => mutex(() => promise - .then(async () : Promise => { - await onStart(test); - return { - ...createEmptyTestResult(), - numPassingTests: 1, - testFilePath: test.path, - testResults: [ - { - ancestorTitles: [], - duration: 2, - failureMessages: [], - fullName: 'sample test', - location: null, - numPassingAsserts: 1, - status: 'passed', - title: 'sample test', - }, - ], - }; - }) + .then( + async (): Promise => { + await onStart(test); + return { + ...createEmptyTestResult(), + numPassingTests: 1, + testFilePath: test.path, + testResults: [ + { + ancestorTitles: [], + duration: 2, + failureMessages: [], + fullName: 'sample test', + location: null, + numPassingAsserts: 1, + status: 'passed', + title: 'sample test', + }, + ], + }; + } + ) .then(result => onResult(test, result)) .catch(err => onFailure(test, err)) ), Promise.resolve() ); } -} +} \ No newline at end of file From 8c6af1b67eed987d6c6fb5372ed56ceb276535d5 Mon Sep 17 00:00:00 2001 From: M4rk9696 Date: Fri, 30 Aug 2019 00:21:14 +0530 Subject: [PATCH 04/11] Fix lint due to newline --- e2e/transform/transform-runner/runner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/transform/transform-runner/runner.ts b/e2e/transform/transform-runner/runner.ts index ca625c070950..4db477a86b15 100644 --- a/e2e/transform/transform-runner/runner.ts +++ b/e2e/transform/transform-runner/runner.ts @@ -66,4 +66,4 @@ export default class BaseTestRunner { Promise.resolve() ); } -} \ No newline at end of file +} From 9ba2a35f6b04a1e5eba83276684f5199bf5eda7d Mon Sep 17 00:00:00 2001 From: M4rk9696 Date: Sat, 31 Aug 2019 14:46:59 +0530 Subject: [PATCH 05/11] Add moduleFileExtensions in tests --- packages/jest-core/src/__tests__/TestScheduler.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/jest-core/src/__tests__/TestScheduler.test.js b/packages/jest-core/src/__tests__/TestScheduler.test.js index 4ccd1899388f..a81228fef64a 100644 --- a/packages/jest-core/src/__tests__/TestScheduler.test.js +++ b/packages/jest-core/src/__tests__/TestScheduler.test.js @@ -88,6 +88,7 @@ test('schedule tests run in parallel per default', async () => { const test = { context: { config: makeProjectConfig({ + moduleFileExtensions: ['.js'], runner: 'jest-runner-parallel', transform: [], }, @@ -110,6 +111,7 @@ test('schedule tests run in serial if the runner flags them', async () => { const test = { context: { config: makeProjectConfig({ + moduleFileExtensions: ['.js'], runner: 'jest-runner-serial', transform: [], }, @@ -132,6 +134,7 @@ test('should bail after `n` failures', async () => { const test = { context: { config: makeProjectConfig({ + moduleFileExtensions: ['.js'], rootDir: './', runner: 'jest-runner-serial', transform: [], @@ -163,6 +166,7 @@ test('should not bail if less than `n` failures', async () => { const test = { context: { config: makeProjectConfig({ + moduleFileExtensions: ['.js'], rootDir: './', runner: 'jest-runner-serial', transform: [], @@ -194,6 +198,7 @@ test('should set runInBand to run in serial', async () => { const test = { context: { config: makeProjectConfig({ + moduleFileExtensions: ['.js'], runner: 'jest-runner-parallel', transform: [], }, @@ -219,6 +224,7 @@ test('should set runInBand to not run in serial', async () => { const test = { context: { config: makeProjectConfig({ + moduleFileExtensions: ['.js'], runner: 'jest-runner-parallel', transform: [], }, From bf97acca62aa4883cfe8ecdf07b8b371a3250eba Mon Sep 17 00:00:00 2001 From: M4rk9696 Date: Sun, 27 Oct 2019 21:24:31 +0530 Subject: [PATCH 06/11] Remove support for node 6 --- e2e/transform/transform-runner/babel.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/transform/transform-runner/babel.config.js b/e2e/transform/transform-runner/babel.config.js index 5e1e38eebb8d..f57a151246bf 100644 --- a/e2e/transform/transform-runner/babel.config.js +++ b/e2e/transform/transform-runner/babel.config.js @@ -11,7 +11,7 @@ module.exports = { [ '@babel/preset-env', { - targets: {node: 6}, + targets: {node: 8}, }, ], ], From b6e1d5cf474e87c4653479f299657858714519bb Mon Sep 17 00:00:00 2001 From: M4rk9696 Date: Sun, 27 Oct 2019 21:25:40 +0530 Subject: [PATCH 07/11] Add CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ad8d3e929b..9f8af2b2a5a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -551,6 +551,7 @@ - `[@jest/test-result]` Create method to create empty `TestResult` ([#8867](https://github.com/facebook/jest/pull/8867)) - `[jest-worker]` [**BREAKING**] Return a promise from `end()`, resolving with the information whether workers exited gracefully ([#8206](https://github.com/facebook/jest/pull/8206)) - `[jest-reporters]` Transform file paths into hyperlinks ([#8980](https://github.com/facebook/jest/pull/8980)) +- `[jest-runner]` [**BREAKING**] Run transforms over `runnner` ([#8823](https://github.com/facebook/jest/pull/8823)) ### Fixes From df745d275f77baa193f9050fd67426f80ac05779 Mon Sep 17 00:00:00 2001 From: Mark1626 Date: Sun, 15 Nov 2020 09:18:24 +0530 Subject: [PATCH 08/11] chore: Move CHANGELOG entry and upgrade e2e dependency and missed items in rebase --- CHANGELOG.md | 2 +- e2e/transform/transform-runner/package.json | 2 +- e2e/transform/transform-runner/runner.ts | 12 ++++++------ packages/jest-core/src/TestScheduler.ts | 2 +- .../jest-core/src/__tests__/TestScheduler.test.js | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8af2b2a5a6..e2d47d1a5316 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - `[jest-runner]` [**BREAKING**] set exit code to 1 if test logs after teardown ([#10728](https://github.com/facebook/jest/pull/10728)) - `[jest-snapshot]`: [**BREAKING**] Make prettier optional for inline snapshots - fall back to string replacement ([#7792](https://github.com/facebook/jest/pull/7792)) - `[jest-repl, jest-runner]` [**BREAKING**] Run transforms over environment ([#8751](https://github.com/facebook/jest/pull/8751)) +- `[jest-runner]` [**BREAKING**] Run transforms over `runnner` ([#8823](https://github.com/facebook/jest/pull/8823)) ### Fixes @@ -551,7 +552,6 @@ - `[@jest/test-result]` Create method to create empty `TestResult` ([#8867](https://github.com/facebook/jest/pull/8867)) - `[jest-worker]` [**BREAKING**] Return a promise from `end()`, resolving with the information whether workers exited gracefully ([#8206](https://github.com/facebook/jest/pull/8206)) - `[jest-reporters]` Transform file paths into hyperlinks ([#8980](https://github.com/facebook/jest/pull/8980)) -- `[jest-runner]` [**BREAKING**] Run transforms over `runnner` ([#8823](https://github.com/facebook/jest/pull/8823)) ### Fixes diff --git a/e2e/transform/transform-runner/package.json b/e2e/transform/transform-runner/package.json index 8ca15ecc190e..5163f3c2e3ec 100644 --- a/e2e/transform/transform-runner/package.json +++ b/e2e/transform/transform-runner/package.json @@ -6,6 +6,6 @@ "dependencies": { "@babel/preset-env": "^7.0.0", "@babel/preset-typescript": "^7.0.0", - "jest-environment-node": "^24.9.0" + "jest-environment-node": "^26.6.2" } } diff --git a/e2e/transform/transform-runner/runner.ts b/e2e/transform/transform-runner/runner.ts index 4db477a86b15..eaeebfd60f5d 100644 --- a/e2e/transform/transform-runner/runner.ts +++ b/e2e/transform/transform-runner/runner.ts @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +import throat from 'throat'; +import {TestResult, createEmptyTestResult} from '@jest/test-result'; import {Config} from '@jest/types'; import { OnTestFailure, @@ -14,8 +16,6 @@ import { TestRunnerContext, TestWatcher, } from 'jest-runner'; -import throat from 'throat'; -import {TestResult, createEmptyTestResult} from '@jest/test-result'; export default class BaseTestRunner { private _globalConfig: Config.GlobalConfig; @@ -31,7 +31,7 @@ export default class BaseTestRunner { watcher: TestWatcher, onStart: OnTestStart, onResult: OnTestSuccess, - onFailure: OnTestFailure + onFailure: OnTestFailure, ): Promise { const mutex = throat(1); return tests.reduce( @@ -58,12 +58,12 @@ export default class BaseTestRunner { }, ], }; - } + }, ) .then(result => onResult(test, result)) - .catch(err => onFailure(test, err)) + .catch(err => onFailure(test, err)), ), - Promise.resolve() + Promise.resolve(), ); } } diff --git a/packages/jest-core/src/TestScheduler.ts b/packages/jest-core/src/TestScheduler.ts index 4324d79e93f8..cf1846b9f214 100644 --- a/packages/jest-core/src/TestScheduler.ts +++ b/packages/jest-core/src/TestScheduler.ts @@ -196,7 +196,7 @@ export default class TestScheduler { if (!testRunners[config.runner]) { const transformer = new ScriptTransformer(config); const Runner: typeof TestRunner = interopRequireDefault( - transformer.requireAndTranspileModule(config.runner) + transformer.requireAndTranspileModule(config.runner), ).default; const runner = new Runner(this._globalConfig, { changedFiles: this._context?.changedFiles, diff --git a/packages/jest-core/src/__tests__/TestScheduler.test.js b/packages/jest-core/src/__tests__/TestScheduler.test.js index a81228fef64a..464a923206fc 100644 --- a/packages/jest-core/src/__tests__/TestScheduler.test.js +++ b/packages/jest-core/src/__tests__/TestScheduler.test.js @@ -91,7 +91,7 @@ test('schedule tests run in parallel per default', async () => { moduleFileExtensions: ['.js'], runner: 'jest-runner-parallel', transform: [], - }, + }), hasteFS: { matchFiles: jest.fn(() => []), }, @@ -114,7 +114,7 @@ test('schedule tests run in serial if the runner flags them', async () => { moduleFileExtensions: ['.js'], runner: 'jest-runner-serial', transform: [], - }, + }), hasteFS: { matchFiles: jest.fn(() => []), }, @@ -138,7 +138,7 @@ test('should bail after `n` failures', async () => { rootDir: './', runner: 'jest-runner-serial', transform: [], - }, + }), hasteFS: { matchFiles: jest.fn(() => []), }, @@ -170,7 +170,7 @@ test('should not bail if less than `n` failures', async () => { rootDir: './', runner: 'jest-runner-serial', transform: [], - }, + }), hasteFS: { matchFiles: jest.fn(() => []), }, @@ -201,7 +201,7 @@ test('should set runInBand to run in serial', async () => { moduleFileExtensions: ['.js'], runner: 'jest-runner-parallel', transform: [], - }, + }), hasteFS: { matchFiles: jest.fn(() => []), }, @@ -227,7 +227,7 @@ test('should set runInBand to not run in serial', async () => { moduleFileExtensions: ['.js'], runner: 'jest-runner-parallel', transform: [], - }, + }), hasteFS: { matchFiles: jest.fn(() => []), }, From 61dab1f23f99364759120d54d1f2b7e39b2a4a28 Mon Sep 17 00:00:00 2001 From: Mark1626 Date: Sun, 15 Nov 2020 19:37:53 +0530 Subject: [PATCH 09/11] chore: Review change --- e2e/transform/transform-runner/babel.config.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/e2e/transform/transform-runner/babel.config.js b/e2e/transform/transform-runner/babel.config.js index f57a151246bf..19dd8862b516 100644 --- a/e2e/transform/transform-runner/babel.config.js +++ b/e2e/transform/transform-runner/babel.config.js @@ -7,12 +7,7 @@ module.exports = { presets: [ - ['@babel/preset-typescript'], - [ - '@babel/preset-env', - { - targets: {node: 8}, - }, - ], + ['@babel/preset-env', {targets: {node: 'current'}}], + '@babel/preset-typescript', ], }; From f1dc0a4db26939d8835bd4cfc20bb3ae34db5581 Mon Sep 17 00:00:00 2001 From: Nimalan Date: Sun, 15 Nov 2020 20:09:25 +0530 Subject: [PATCH 10/11] chore: Review change add import @jest/types as type Co-authored-by: Simen Bekkhus --- e2e/transform/transform-runner/runner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/transform/transform-runner/runner.ts b/e2e/transform/transform-runner/runner.ts index eaeebfd60f5d..093ffc0242db 100644 --- a/e2e/transform/transform-runner/runner.ts +++ b/e2e/transform/transform-runner/runner.ts @@ -7,7 +7,7 @@ import throat from 'throat'; import {TestResult, createEmptyTestResult} from '@jest/test-result'; -import {Config} from '@jest/types'; +import type {Config} from '@jest/types'; import { OnTestFailure, OnTestStart, From f54626834d96fdb6fd5e7505159c7593ac2079e5 Mon Sep 17 00:00:00 2001 From: Mark1626 Date: Sun, 15 Nov 2020 20:22:18 +0530 Subject: [PATCH 11/11] chore: Use file protocol to resolve dependency --- e2e/transform/transform-environment/package.json | 2 +- e2e/transform/transform-runner/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/transform/transform-environment/package.json b/e2e/transform/transform-environment/package.json index e1104c0a57f9..c34e478bb8aa 100644 --- a/e2e/transform/transform-environment/package.json +++ b/e2e/transform/transform-environment/package.json @@ -9,6 +9,6 @@ "dependencies": { "@babel/preset-env": "^7.0.0", "@babel/preset-typescript": "^7.0.0", - "jest-environment-node": "^26.6.2" + "jest-environment-node": "file:../../../packages/jest-environment-node" } } diff --git a/e2e/transform/transform-runner/package.json b/e2e/transform/transform-runner/package.json index 5163f3c2e3ec..eea777afc0df 100644 --- a/e2e/transform/transform-runner/package.json +++ b/e2e/transform/transform-runner/package.json @@ -6,6 +6,6 @@ "dependencies": { "@babel/preset-env": "^7.0.0", "@babel/preset-typescript": "^7.0.0", - "jest-environment-node": "^26.6.2" + "jest-environment-node": "file:../../../packages/jest-environment-node" } }