Skip to content

Commit db055c2

Browse files
authored
Fix type ellision of jest-runtime imports (#9717)
1 parent 6f8bf80 commit db055c2

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### Fixes
66

7+
- `[jest-circus]` Fix type ellision of jest-runtime imports ([#9717](https://github.com/facebook/jest/pull/9717))
8+
79
### Chore & Maintenance
810

911
### Performance

packages/jest-circus/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"jest-each": "^25.2.3",
2929
"jest-matcher-utils": "^25.2.3",
3030
"jest-message-util": "^25.2.3",
31+
"jest-runtime": "^25.2.3",
3132
"jest-snapshot": "^25.2.3",
3233
"jest-util": "^25.2.3",
3334
"pretty-format": "^25.2.3",
@@ -41,8 +42,7 @@
4142
"@types/babel__traverse": "^7.0.4",
4243
"@types/co": "^4.6.0",
4344
"@types/stack-utils": "^1.0.1",
44-
"execa": "^3.2.0",
45-
"jest-runtime": "^25.2.3"
45+
"execa": "^3.2.0"
4646
},
4747
"engines": {
4848
"node": ">= 8.3"

packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as path from 'path';
99
import type {Config} from '@jest/types';
1010
import type {JestEnvironment} from '@jest/environment';
1111
import type {TestResult} from '@jest/test-result';
12-
import Runtime = require('jest-runtime');
12+
import type {RuntimeType as Runtime} from 'jest-runtime';
1313
import type {SnapshotStateType} from 'jest-snapshot';
1414

1515
const FRAMEWORK_INITIALIZER = require.resolve('./jestAdapterInit');

packages/jest-jasmine2/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {Config, Global} from '@jest/types';
1010
import type {AssertionResult, TestResult} from '@jest/test-result';
1111
import type {JestEnvironment} from '@jest/environment';
1212
import type {SnapshotStateType} from 'jest-snapshot';
13-
import Runtime = require('jest-runtime');
13+
import type {RuntimeType as Runtime} from 'jest-runtime';
1414

1515
import {getCallsite} from '@jest/source-map';
1616
import installEach from './each';

packages/jest-runtime/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ type CacheFS = {[path: string]: string};
6464

6565
namespace Runtime {
6666
export type Context = JestContext;
67+
// ditch this export when moving to esm - for now we need it for to avoid faulty type elision
68+
export type RuntimeType = Runtime;
6769
}
6870

6971
const testTimeoutSymbol = Symbol.for('TEST_TIMEOUT_SYMBOL');

0 commit comments

Comments
 (0)