ā test(pariksha): doc-links.ts passes the mutation gate
Slice: #316
#309 fixed how lycheeRunner reports a lychee that exits before reading its file list, and added the tests for it. Because it changed doc-links.ts, the gate now judges the whole file. This pull request makes the file pass: no mutant Survived or NoCoverage against doc-links.test.ts alone. What the link check reports does not change.
Counts
Stryker 10.1.1 with the tap runner, mutate: ["src/doc-links.ts"], tap.testFiles: ["src/doc-links.test.ts"], incremental mode off. Run locally on macOS at --concurrency 6, each run in about 1.5 minutes.
| Run | Mutants | Killed | Survived | NoCoverage |
|---|---|---|---|---|
main (0b59b43) | 272 | 260 | 12 | 0 |
| This branch | 251 | 251 | 0 | 0 |
None of the 12 were in lycheeRunner. The count drops because code that no test could observe is gone (below).
How
Following docs/lessons/stryker.md, code that a mutant could not change observably is reshaped, not suppressed:
treeFor: git and tar run through onequietly()helper withstdio: 'pipe', and the catch reusesreleaseinstead of its ownrmSync. The bad-ref test now asserts three things: the error is git's own (status 128), nothing is copied toprocess.stderr(execFileSyncwithoutstdiowould copy it), and nothing is left in a stand-inTMPDIR. Before,assert.throwsaccepted any error, includingrmSync's own.- Report parser: a missing
error_mapgets a destructuring default, so it goes through the normal path instead of returning early. Anullone is still refused, and the out-of-shape table now names that case. A span line is checked by anisLineNumberguard, without thetypeoftest that only TypeScript needed, sinceNumber.isSafeIntegeralready refuses every other type. - Exemptions: the marker reads the line through an optional chain, which the tests for a line past the end and a missing doc exercise. The target regex drops a
$that no ref could tell apart. - Ignore filter:
askedFornames the paths the ignore rules are asked about: the target as a file and as a directory. It names none for an in-doc anchor or a target outside the repository, so the twonullbranches are gone. A test wrapssnapshot.ignoredand asserts exactly what is asked.
Checks
pnpm --filter @veda-hq/pariksha check: green. 3910 tests pass, anddoc-links.tsis at 100% lines, branches and functions.- ESLint on both files: clean.
eslint-suppressions.jsonis unchanged. - No version bump.
š¤ Generated with Claude Code
Summary by cubic
Reworks doc-links.ts so no Stryker mutant survives or lacks coverage when judged against doc-links.test.ts alone. The link check's behavior is unchanged; code no test could observe is reshaped instead of suppressed.
- git and tar in
treeForshare aquietly()helper with piped stdio, and the catch reusesrelease(). The bad-ref test now asserts git's own error, nothing copied to the process's stderr, and nothing left inTMPDIR. - A missing
error_mapgoes through the normal path via a destructuring default; anullone is still refused. - Exemptions read the line through an optional chain, and the target regex drops a
$no ref could tell apart. askedFornames the paths the ignore rules are asked about; an in-doc anchor and a target outside the repository are skipped, with a comment explaining why, and a test asserts exactly what is asked.