Skip to content

Commit

Permalink
fix(expect): remove @types/node from dependencies (#14385)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitri-gb committed Aug 16, 2023
1 parent 49bacb9 commit 0cbe04d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

### Fixes

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

### Chore & Maintenance
Expand Down
1 change: 0 additions & 1 deletion packages/expect/package.json
Expand Up @@ -20,7 +20,6 @@
},
"dependencies": {
"@jest/expect-utils": "workspace:^",
"@types/node": "*",
"jest-get-type": "workspace:^",
"jest-matcher-utils": "workspace:^",
"jest-message-util": "workspace:^",
Expand Down
3 changes: 1 addition & 2 deletions packages/expect/src/types.ts
Expand Up @@ -6,7 +6,6 @@
*
*/

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

export interface MatcherState {
assertionCalls: number;
currentConcurrentTestName?: AsyncLocalStorage<string>;
currentConcurrentTestName?: () => string | undefined;
currentTestName?: string;
error?: Error;
expand?: boolean;
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-circus/src/run.ts
Expand Up @@ -137,7 +137,9 @@ function collectConcurrentTests(
function startTestsConcurrently(concurrentTests: Array<ConcurrentTestEntry>) {
const mutex = pLimit(getState().maxConcurrency);
const testNameStorage = new AsyncLocalStorage<string>();
jestExpect.setState({currentConcurrentTestName: testNameStorage});
jestExpect.setState({
currentConcurrentTestName: () => testNameStorage.getStore(),
});
for (const test of concurrentTests) {
try {
const testFn = test.fn;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-snapshot/src/index.ts
Expand Up @@ -281,7 +281,7 @@ const _toMatchSnapshot = (config: MatchSnapshotConfig) => {

const {currentConcurrentTestName, isNot, snapshotState} = context;
const currentTestName =
currentConcurrentTestName?.getStore() ?? context.currentTestName;
currentConcurrentTestName?.() ?? context.currentTestName;

if (isNot) {
throw new Error(
Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Expand Up @@ -9776,7 +9776,6 @@ __metadata:
"@jest/expect-utils": "workspace:^"
"@jest/test-utils": "workspace:^"
"@tsd/typescript": ^5.0.4
"@types/node": "*"
chalk: ^4.0.0
immutable: ^4.0.0
jest-get-type: "workspace:^"
Expand Down

0 comments on commit 0cbe04d

Please sign in to comment.