Skip to content

Commit 7628207

Browse files
authored
fix: incorrectly setting the name of currently running concurrent test (#14335)
1 parent 10bfa61 commit 7628207

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixes
66

7+
- `[jest-circus]` Fix snapshot matchers in concurrent tests when nr of tests exceeds `maxConcurrency` ([#14335](https://github.com/jestjs/jest/pull/14335))
78
- `[jest-snapshot]` Move `@types/prettier` from `dependencies` to `devDependencies` ([#14328](https://github.com/jestjs/jest/pull/14328))
89

910
### Chore & Maintenance

packages/jest-circus/src/run.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ function startTestsConcurrently(concurrentTests: Array<ConcurrentTestEntry>) {
140140
jestExpect.setState({currentConcurrentTestName: testNameStorage});
141141
for (const test of concurrentTests) {
142142
try {
143-
const promise = testNameStorage.run(getTestID(test), () =>
144-
mutex(test.fn),
145-
);
143+
const testFn = test.fn;
144+
const promise = mutex(() => testNameStorage.run(getTestID(test), testFn));
146145
// Avoid triggering the uncaught promise rejection handler in case the
147146
// test fails before being awaited on.
148147
// eslint-disable-next-line @typescript-eslint/no-empty-function

0 commit comments

Comments
 (0)