Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixes

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

### Chore & Maintenance
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-circus/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ function startTestsConcurrently(concurrentTests: Array<ConcurrentTestEntry>) {
jestExpect.setState({currentConcurrentTestName: testNameStorage});
for (const test of concurrentTests) {
try {
const promise = testNameStorage.run(getTestID(test), () =>
mutex(test.fn),
);
const testFn = test.fn;
const promise = mutex(() => testNameStorage.run(getTestID(test), testFn));
// Avoid triggering the uncaught promise rejection handler in case the
// test fails before being awaited on.
// eslint-disable-next-line @typescript-eslint/no-empty-function
Expand Down