Skip to content

Commit 0cbe04d

Browse files
authored
fix(expect): remove @types/node from dependencies (#14385)
1 parent 49bacb9 commit 0cbe04d

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixes
66

7+
- `[expect]` Remove `@types/node` from dependencies ([#14385](https://github.com/jestjs/jest/pull/14385))
78
- `[jest-reporters]` Update `istanbul-lib-instrument` dependency to v6. ([#14401](https://github.com/jestjs/jest/pull/14401))
89

910
### Chore & Maintenance

packages/expect/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"dependencies": {
2222
"@jest/expect-utils": "workspace:^",
23-
"@types/node": "*",
2423
"jest-get-type": "workspace:^",
2524
"jest-matcher-utils": "workspace:^",
2625
"jest-message-util": "workspace:^",

packages/expect/src/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*
77
*/
88

9-
import type {AsyncLocalStorage} from 'async_hooks';
109
import type {EqualsFunction, Tester} from '@jest/expect-utils';
1110
import type * as jestMatcherUtils from 'jest-matcher-utils';
1211
import {INTERNAL_MATCHER_FLAG} from './jestMatchersObject';
@@ -58,7 +57,7 @@ export interface MatcherUtils {
5857

5958
export interface MatcherState {
6059
assertionCalls: number;
61-
currentConcurrentTestName?: AsyncLocalStorage<string>;
60+
currentConcurrentTestName?: () => string | undefined;
6261
currentTestName?: string;
6362
error?: Error;
6463
expand?: boolean;

packages/jest-circus/src/run.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ function collectConcurrentTests(
137137
function startTestsConcurrently(concurrentTests: Array<ConcurrentTestEntry>) {
138138
const mutex = pLimit(getState().maxConcurrency);
139139
const testNameStorage = new AsyncLocalStorage<string>();
140-
jestExpect.setState({currentConcurrentTestName: testNameStorage});
140+
jestExpect.setState({
141+
currentConcurrentTestName: () => testNameStorage.getStore(),
142+
});
141143
for (const test of concurrentTests) {
142144
try {
143145
const testFn = test.fn;

packages/jest-snapshot/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ const _toMatchSnapshot = (config: MatchSnapshotConfig) => {
281281

282282
const {currentConcurrentTestName, isNot, snapshotState} = context;
283283
const currentTestName =
284-
currentConcurrentTestName?.getStore() ?? context.currentTestName;
284+
currentConcurrentTestName?.() ?? context.currentTestName;
285285

286286
if (isNot) {
287287
throw new Error(

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9776,7 +9776,6 @@ __metadata:
97769776
"@jest/expect-utils": "workspace:^"
97779777
"@jest/test-utils": "workspace:^"
97789778
"@tsd/typescript": ^5.0.4
9779-
"@types/node": "*"
97809779
chalk: ^4.0.0
97819780
immutable: ^4.0.0
97829781
jest-get-type: "workspace:^"

0 commit comments

Comments
 (0)