-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
Description
Version
30.0.0-beta.4
Steps to reproduce
- Clone repo at https://github.com/lencioni/jest-abortsignal-timeout-bug
- Run
yarn install
- Run
yarn jest
You may need to run tests more than once to reproduce.
Expected behavior
I expect the tests to consistently pass.
Actual behavior
The second test will often tail because AbortSignal.timeout
ends up being undefined.
PASS __tests__/2.test.js
FAIL __tests__/1.test.js
● has AbortSignal.timeout
expect(received).toBeDefined()
Received: undefined
1 | it("has AbortSignal.timeout", () => {
> 2 | expect(AbortSignal.timeout).toBeDefined();
| ^
3 | });
4 |
at Object.toBeDefined (__tests__/1.test.js:2:31)
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 failed, 1 passed, 2 total
Snapshots: 0 total
Time: 0.105 s, estimated 1 s
PASS __tests__/1.test.js
FAIL __tests__/2.test.js
● has AbortSignal.timeout
expect(received).toBeDefined()
Received: undefined
1 | it("has AbortSignal.timeout", () => {
> 2 | expect(AbortSignal.timeout).toBeDefined();
| ^
3 | });
4 |
at Object.toBeDefined (__tests__/2.test.js:2:31)
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 failed, 1 passed, 2 total
Snapshots: 0 total
Time: 0.139 s, estimated 1 s
Additional context
No response
Environment
System:
OS: macOS 15.4.1
CPU: (8) arm64 Apple M3
Binaries:
Node: 22.16.0 - ~/.local/share/mise/installs/node/22.16.0/bin/node
Yarn: 1.22.22 - ~/.local/share/mise/installs/yarn/1.22.22/bin/yarn
npm: 10.9.2 - ~/.local/share/mise/installs/node/22.16.0/bin/npm
npmPackages:
jest: 30.0.0-beta.4 => 30.0.0-beta.4