diff options
Diffstat (limited to 'languages/typescript/claude/rules')
| -rw-r--r-- | languages/typescript/claude/rules/typescript-testing.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/languages/typescript/claude/rules/typescript-testing.md b/languages/typescript/claude/rules/typescript-testing.md index bd6933f..31c50fc 100644 --- a/languages/typescript/claude/rules/typescript-testing.md +++ b/languages/typescript/claude/rules/typescript-testing.md @@ -113,6 +113,23 @@ Workflow: invoke `/pairwise-tests` → get a PICT model + generated test matrix → paste the matrix into an `it.each` block. See `testing.md` § Combinatorial Coverage for the general rule and when to skip. +## Measuring Coverage — `make coverage-summary` + +The bundle ships a coverage summary at `.claude/scripts/coverage-summary.js` +and a Makefile fragment (`coverage-makefile.txt`) with `coverage` and +`coverage-summary` targets. After the suite runs under c8 (or Vitest/Jest with +the json-summary reporter) and writes `coverage/coverage-summary.json`, `make +coverage-summary` prints a file-weighted project number and the source files no +test imported. + +The number to watch is that missing-file count. A module no test imports never +appears in the Istanbul report, so a statement-weighted total skips it silently +and the suite looks healthier than it is. The summary counts every `.ts`/`.js` +under the source dir that's absent from the report as 0%, so an untested module +drags the project number down where you can see it. It doesn't reimplement the +per-file table — nyc/c8 already print that. Copy the fragment's targets into +your own Makefile to adopt it; the bundle never edits your Makefile. + ## Mocking Guidelines ### Mock these (external boundaries): |
