[Bug]: `assertion` failed when executing tests use `test.concurrent(...)`
Version
v27.0.0
Steps to reproduce
https://stackblitz.com/edit/jest-cocurrent-test
Expected behavior
I expect the test1 should be passed, the assertionCalls should be 3.
Actual behavior
The test1 fails with the following error,
FAIL ./assertion.test.ts
✕ test1 (35 ms)
✓ test2 (57 ms)
● test1
expect.assertions(1)
Expected one assertion to be called but received three assertion calls.
19 |
20 | test.concurrent('test2', async () => {
> 21 | expect.assertions(1);
| ^
22 | await delay(100).then(() => {
23 | expect(2).toEqual(2);
24 | });
at Object.<anonymous> (assertion.test.ts:21:10)
at assertion.test.ts:7:71
at Object.<anonymous>.__awaiter (assertion.test.ts:3:12)
at assertion.test.ts:20:37
at node_modules/throat/index.js:11:20
at run (node_modules/throat/index.js:10:14)
at node_modules/throat/index.js:70:12
Additional context
None
Environment
System:
OS: Linux 5.0 undefined
CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.10 - /bin/yarn
npm: 7.17.0 - /bin/npm
npmPackages:
jest: ^27.0.0 => 27.0.0
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Commenting to keep this alive.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Commenting to keep this alive. Still an issue in Jest v29.0.3.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Commenting to keep this issue open.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This is still an issue.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Bump
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
It's an issue for me too. I solved it by removing the concurrency.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.