I built a tool to catch empty scans read as passes, and shipped it with an empty scan read as a pass
Description and use
The updated test suite now correctly flags empty scans as failures, preventing silent bugs and improving test reliability.
Problem
Test suites reported passes when no files were scanned, masking real defects in fixture-based testing.
Outcome
The updated test suite now correctly flags empty scans as failures, preventing silent bugs and improving test reliability.
Workflow
- 1. Add a self‑test that plants two positive and four negative fixtures. 2. Run the test and print a control line after the green status. 3. Detect if filesScanned===0 and exit with non‑zero status. 4. Add mutation controls: one build with a missing vocabulary term, another with a damaged pattern. 5. Ensure each mutation control fails (exits 1) when the defect is present. 6. Update the self‑test to output which signal saw each positive fixture for visibility.
Evidence
The line: a fixture run where filesScanned === 0 is untestable rather than ok, and it exits non-zero.
I added two mutation controls as well: deliberately broken builds, one with a term removed from the vocabulary and one with the pattern damaged.
- Record date: 2026-09-07T11:32:04.781Z