From 8ad750c60af724354983d40a244963b95729f3c0 Mon Sep 17 00:00:00 2001 From: david raistrick <1108844+keen99@users.noreply.github.com> Date: Sat, 4 Jul 2026 17:03:34 -0400 Subject: [PATCH] test: add 10s timeout guard across all suites MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hangs/regressions fail fast instead of stalling CI. - shared/jest.config.js: testTimeout 10000 - src/setupTests.js: jest.setTimeout(10000) (CRA blocks testTimeout in package.json — not in allowlist) - server/jest.config.js: already had 10000 Verified: injected hanging test -> 'Exceeded timeout of 10000 ms'. --- shared/jest.config.js | 1 + src/setupTests.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/shared/jest.config.js b/shared/jest.config.js index 610cf77..7de6efb 100644 --- a/shared/jest.config.js +++ b/shared/jest.config.js @@ -3,4 +3,5 @@ module.exports = { testEnvironment: 'node', testMatch: ['/tests/**/*.test.js'], collectCoverageFrom: ['turn.js'], + testTimeout: 10000, }; diff --git a/src/setupTests.js b/src/setupTests.js index 40a8308..842d6b0 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -8,6 +8,10 @@ import { resetMockDb } from './__mocks__/firebase/_mock-db'; // Must be set before any component renders. globalThis.IS_REACT_ACT_ENVIRONMENT = true; +// Test timeout guard. CRA blocks `testTimeout` in package.json jest config +// (not in allowlist). Set via jest global here instead. Fails fast on hang. +jest.setTimeout(10000); + // WARNING = FAILURE. Fail test on any console.error/warn (React act warnings, // deprecations, prop errors). App code's own error logs allowed only inside // try/catch failure paths — those tests should assert the error was handled,