forked from AgesEmpire/StellarSwipe-Backends
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.chaos.config.js
More file actions
35 lines (34 loc) · 1.16 KB
/
Copy pathjest.chaos.config.js
File metadata and controls
35 lines (34 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Jest configuration for chaos / resilience tests.
*
* Kept separate from the main jest.config.js so chaos tests:
* - Do not run in the standard `npm test` / CI unit-test pipeline.
* - Have a longer timeout budget (failures + retries take more time).
* - Are run serially (--runInBand) to avoid port / resource contention.
*
* Usage:
* npx jest --config jest.chaos.config.js
* npx jest --config jest.chaos.config.js --testPathPattern=database
* npx jest --config jest.chaos.config.js --verbose
*/
module.exports = {
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
testRegex: 'test/chaos/.*\\.chaos\\.ts$',
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
testEnvironment: 'node',
// Run serially — chaos tests mutate shared state (axios interceptors, mocks)
runInBand: true,
// Chaos tests involve intentional delays and retry loops
testTimeout: 60_000,
setupFilesAfterEnv: ['<rootDir>/test/chaos/chaos.setup.ts'],
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
'^test/(.*)$': '<rootDir>/test/$1',
},
// Do not enforce coverage thresholds for chaos tests
collectCoverage: false,
verbose: true,
};