-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathstryker.config.mjs
More file actions
86 lines (77 loc) · 2.95 KB
/
Copy pathstryker.config.mjs
File metadata and controls
86 lines (77 loc) · 2.95 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
80
81
82
83
84
85
86
// @ts-check
/** @type {import('@stryker-mutator/api/core').PartialStrykerOptions} */
export default {
$schema: './node_modules/@stryker-mutator/core/schema/stryker-schema.json',
packageManager: 'pnpm',
// Explicit plugin registration. pnpm's isolated node_modules layout
// sometimes breaks Stryker's auto-discovery of runner + checker
// packages — listing them here is deterministic.
plugins: [
'@stryker-mutator/vitest-runner',
'@stryker-mutator/typescript-checker',
],
testRunner: 'vitest',
testRunner_comment: 'vitest config at vitest.config.mts is picked up automatically',
vitest: {
configFile: 'vitest.config.mts',
},
// Mutate every module that has unit test coverage. Next.js app code
// (app/, components/, ui/, providers/, modules/) is under-tested and
// would add hours of wall-clock time without telling us anything
// useful — leave those out until they grow real tests.
mutate: [
'src/services/**/*.ts',
'src/scheduler/**/*.ts',
'src/hardware/**/*.ts',
'src/lib/**/*.ts',
'src/homekit/**/*.ts',
'src/server/**/*.ts',
'src/streaming/**/*.ts',
'src/hooks/**/*.ts',
'src/hooks/**/*.tsx',
'src/db/**/*.ts',
'!src/**/tests/**',
'!src/**/*.test.ts',
'!src/**/*.test.tsx',
'!src/**/*.d.ts',
],
// Skip "static mutants" — mutations inside module-level / constant
// initializer code that runs once at load time. Because they mutate
// values captured at import, they'd require a full test-process restart
// to re-evaluate, which Stryker can't do cheaply. `true` marks them as
// `Ignored` rather than wasting runner cycles. Does NOT skip whole
// uncovered files — use the `mutate` globs for that.
ignoreStatic: true,
// Type-check each mutant so we don't waste runner cycles on mutants that
// can't even compile. Matches the project's tsc --noEmit CI step.
checkers: ['typescript'],
tsconfigFile: 'tsconfig.json',
// Concurrency: matches typical GH Actions runner CPU count.
concurrency: 4,
// Per-mutant timeout. Default 5s is too tight for services that poll DBs
// / await setTimeout. Scheduler + autoOffWatcher tests include real
// timers. 15s is still short relative to test-suite runtime.
timeoutMS: 15000,
timeoutFactor: 2,
// Cache passed mutants across runs so reruns are fast. Stored under
// reports/mutation/ so local .gitignore already covers it.
incremental: true,
incrementalFile: 'reports/mutation/incremental.json',
reporters: ['html', 'clear-text', 'progress', 'json'],
htmlReporter: {
fileName: 'reports/mutation/index.html',
},
jsonReporter: {
fileName: 'reports/mutation/mutation.json',
},
// Thresholds are advisory for now; break=null means we never fail CI on
// low score. Tighten over time as real coverage gaps get closed.
thresholds: {
high: 80,
low: 60,
break: null,
},
tempDirName: '.stryker-tmp',
cleanTempDir: true,
disableTypeChecks: '{src,test}/**/*.{js,ts,tsx,jsx}',
}