-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstryker.config.ts
More file actions
58 lines (55 loc) · 2.46 KB
/
Copy pathstryker.config.ts
File metadata and controls
58 lines (55 loc) · 2.46 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
import { availableParallelism } from "node:os";
import { type PartialStrykerOptions, sharedConfig } from "./stryker.shared.config.ts";
const CPU_SHARE = 0.75;
const MAX_CONCURRENCY = 12;
export default {
...sharedConfig,
// Retain the shared 75%-of-CPU limit on smaller machines while keeping the
// measured 12-worker ceiling. Higher concurrency caused healthy mutants to
// be reported as timeouts, which inflated the score instead of testing them.
concurrency: Math.max(
1,
Math.min(MAX_CONCURRENCY, Math.floor(availableParallelism() * CPU_SHARE)),
),
// Reads backwards: `false` is what KEEPS type checking. The default
// prepends `// @ts-nocheck` to every sandbox file, which blinds the
// typescript checker (nothing to reject) and defuses the deliberate
// type errors in `test/fixtures/typecheck` that the typecheck runner's
// integration tests assert on. Vitest strips types without checking them,
// so nothing needs the prepend.
disableTypeChecks: false,
// Generated outputs are never inputs to the unit suite. In particular,
// `dist` contains the 102 MB SEA executable; copying it into every sandbox
// adds filesystem and antivirus work without changing mutant behaviour.
ignorePatterns: ["dist", "coverage", "out-tsc"],
// Test fixtures are inputs to formatter tests, not shipped implementation.
// Mutating them only checks whether a test notices its own test data
// changing.
mutate: [
...(sharedConfig.mutate ?? []).filter(
(pattern): pattern is string => pattern !== undefined,
),
"!src/**/__fixtures__/**",
],
// A floor, not a target. It exists so a refactor that quietly weakens the
// suite fails loudly; ratchet it up as survivors get killed, and delete it
// once the repo's 100% policy is met.
//
// This one went DOWN once, from 93.5, and that is not a coverage
// regression: 93.5 was measured while the vitest runner was reporting
// mutants it had never tested (see the patch note for #776). The suite it
// described did not exist. 92.5 is what the fixed runner measures — 92.53
// on the commit that landed the patch, 92.54 with this package's own
// change on top. Ratchet from here.
thresholds: {
...sharedConfig.thresholds,
break: 92.5,
},
timeoutMS: 10_000,
tsconfigFile: "tsconfig.json",
vitest: {
// Not `vitest.config.ts` — that one carries four projects, three of
// which drive real processes or the network. See the header there.
configFile: "vitest.stryker.config.ts",
},
} satisfies PartialStrykerOptions;