Skip to content

[Bug]: testTimeout in a project config is accepted but never applied #16510

Open

Description

@MoogyG

Version

30.5.2

Steps to reproduce

Minimal reproduction: https://github.com/MoogyG/jest-project-testtimeout-repro (npm ci && npm test).

Its only dependency is [email protected], and its whole Jest setup is these two files:

// jest.config.js
module.exports = {
  projects: [{ displayName: 'a', rootDir: '<rootDir>/a', testTimeout: 30000 }],
};
// a/slow.test.js
test('waits 6 s', () => new Promise((resolve) => setTimeout(resolve, 6000)));

Run npx jest.

Expected behavior

The test passes: the project sets testTimeout: 30000, and the test takes 6 s.

Actual behavior

The test fails with the default timeout:

thrown: "Exceeded timeout of 5000 ms for a test.

npx jest --showConfig shows configs[0].testTimeout: 30000 and no globalConfig.testTimeout, so the option is accepted and normalized, but nothing reads it. A beforeAll hook that takes 6 s fails the same way ("Exceeded timeout of 5000 ms for a hook").

Moving testTimeout: 30000 to the top level of jest.config.js makes the test pass.

Additional context

jest-circus only reads the global value, in packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts:

if (globalConfig.testTimeout) {
  getRunnerState().testTimeout = globalConfig.testTimeout;
}

config.testTimeout (the project value) is not read anywhere in jest-circus or jest-runner.

Related:

Environment

System:
  OS: macOS 26.6.2
  CPU: (10) arm64 Apple M4
Binaries:
  Node: 24.22.0
  npm: 11.19.1
npmPackages:
  jest: ^30.5.2 => 30.5.2

Activity

  1. GautamKumarOffical commented on Nov 5, 2026

    @GautamKumarOffical

    I'd like to take this on. I'll inspect jest-circus and jest-runner to make sure config.testTimeout takes effect per project as expected and add unit/integration test coverage.

  2. added a commit that references this issue on Nov 9, 2026
    644c705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions