Skip to content

[Bug]: Jest 30 beta 4 causes AbortSignal.timeout to be undefined #15635

@lencioni

Description

@lencioni

Version

30.0.0-beta.4

Steps to reproduce

  1. Clone repo at https://github.com/lencioni/jest-abortsignal-timeout-bug
  2. Run yarn install
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions