test: add 10s timeout guard across all suites
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'.
This commit is contained in:
@@ -3,4 +3,5 @@ module.exports = {
|
|||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
testMatch: ['<rootDir>/tests/**/*.test.js'],
|
testMatch: ['<rootDir>/tests/**/*.test.js'],
|
||||||
collectCoverageFrom: ['turn.js'],
|
collectCoverageFrom: ['turn.js'],
|
||||||
|
testTimeout: 10000,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ import { resetMockDb } from './__mocks__/firebase/_mock-db';
|
|||||||
// Must be set before any component renders.
|
// Must be set before any component renders.
|
||||||
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
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,
|
// WARNING = FAILURE. Fail test on any console.error/warn (React act warnings,
|
||||||
// deprecations, prop errors). App code's own error logs allowed only inside
|
// deprecations, prop errors). App code's own error logs allowed only inside
|
||||||
// try/catch failure paths — those tests should assert the error was handled,
|
// try/catch failure paths — those tests should assert the error was handled,
|
||||||
|
|||||||
Reference in New Issue
Block a user