-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstryker.config.mjs
More file actions
79 lines (72 loc) · 2.67 KB
/
Copy pathstryker.config.mjs
File metadata and controls
79 lines (72 loc) · 2.67 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* Stryker mutation testing - shared base configuration.
*
* See docs/decisions/ADR-0011 (added in T-04h) for scope, thresholds,
* survivor-handling policy, and cadence. Per-module scope is extended
* across T-04d (repositories), T-04f (parser), T-04g (import).
*
* Blanket exclusions applied to every mutate path:
* - *.test.ts / *.test.tsx: the tests themselves are not mutated
* - test-setup.ts: vitest setup files with environment polyfills
* - test-helpers.ts: shared test utilities
* - index.ts: barrel re-exports with no logic
*
* Per-mutant exclusions (equivalent mutants or intentional-weakness tests)
* are annotated inline in the source via `// Stryker disable next-line ...`
* comments rather than collected here. That keeps the justification next
* to the code it concerns.
*
* Per-module configs (stryker.crypto.mjs, stryker.repos.mjs, etc.)
* import this base and override mutate + thresholds. The base config
* itself contains ALL modules with the lowest threshold (parser's 55)
* so that a single `npx stryker run` sanity-checks the full codebase.
* The nightly CI runs each per-module config for accurate per-module
* threshold enforcement.
*/
export const STRYKER_EXCLUDES = [
'!src/**/*.test.ts',
'!src/**/*.test.tsx',
'!src/**/test-setup.ts',
'!src/**/test-helpers.ts',
// Test-only mock factories (vi.mock helpers) live under testHelpers/.
// Exercised via vi.mock in other test files, never in production.
'!src/**/testHelpers/**',
'!src/**/index.ts',
];
export const strykerBase = {
packageManager: 'npm',
testRunner: 'vitest',
checkers: ['typescript'],
tsconfigFile: 'tsconfig.json',
coverageAnalysis: 'perTest',
reporters: ['html', 'clear-text', 'progress'],
htmlReporter: {
fileName: 'reports/mutation/index.html',
},
timeoutMS: 60000,
// Initial dry-run timeout. Default is 5 minutes; the full Vitest
// suite on a 4-vCPU runner with perTest coverage instrumentation
// approaches that ceiling, causing intermittent dry-run failures
// (mutation-nightly red 2026-04-18 to 2026-04-21). 15 minutes
// gives 3x headroom for future suite growth.
dryRunTimeoutMinutes: 15,
concurrency: 4,
};
// Default export: full combined scope, lowest module threshold.
export default {
...strykerBase,
mutate: [
'src/crypto/**/*.ts',
'src/db/repositories/**/*.ts',
'src/features/profile-import/parser/**/*.ts',
'src/features/profile-import/import/**/*.ts',
...STRYKER_EXCLUDES,
],
// Combined threshold = lowest module (parser at 55).
// Per-module enforcement happens via module-specific configs.
thresholds: {
high: 90,
low: 70,
break: 55,
},
};