ā test(pariksha): cli.test.ts counts cli.ts's coverage, and its lychee stand-in reads its input
Merged
AT
10d ago+12+12+01234567890123456789-13-13-01234567890123456789
Fixes main, red since #297 merged (5562165): CI run 44614782116, job "Typecheck, test, build", where the lychee test below was the one failing test. Both causes were in packages/pariksha/src/cli.test.ts, and only that file changes.
cli.tscoverage read 36.58% of lines. The test that an import leaves the importer's exit code alone imported a second instance ofcli.ts(cli.ts?import=ā¦) into the suite's own process. Node's coverage report took that instance, which ran only the module's top level, for the file.- The test now runs in a child process, as the script test beside it does.
- With the fix,
pnpm --filter @veda-hq/pariksha checkreadscli.tsat 100% lines, branches and functions, and all files at 99.97%. Before it, the same suite readcli.tsat 36.58% lines and 6.25% functions. - Stryker still kills the three mutants on those lines (
--mutate src/cli.ts:1284-1285: Killed 3). The child gets the active mutant through its environment.
- "runs lychee from PATH when it is given no runner" failed with EPIPE. The stand-in lychee exited without reading the list pariksha writes to its stdin, so the write could hit a closed pipe.
- It now reads its input first (
cat > /dev/null), as the stand-in incli.doc-references.test.tsdoes. It cannot exit until pariksha has written the list and closed the pipe. - The EPIPE did not reproduce on macOS, under load or under Stryker, so the fix rests on that ordering, not on a reproduction.
- It now reads its input first (
pnpm --filter @veda-hq/pariksha check is green.
Guard: the file's test count is unchanged (one it moves into a child process), so Guard can count it from the diff. If it cannot, #269's Guards: section now names the file, and this pull request waits for Alok's Decision: comment on #269.
š¤ Generated with Claude Code