Skip to content

Commit

Permalink
fix: incorrectly setting the name of currently running concurrent test (
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitri-gb committed Jul 21, 2023
1 parent 10bfa61 commit 7628207
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 7628207

Please sign in to comment.