test: add coverage reporting with regression thresholds

Add v8 coverage via a test:coverage script and vitest config: measure src
only, exclude the types-only deps.ts and the bin entrypoint main.ts, and
gate on ratcheted thresholds (statements 85, branches 78, functions 90,
lines 85) set just under current coverage. CI runs the unit+integration
tier through coverage so a real drop fails the build.
This commit is contained in:
2026-07-11 09:06:11 -04:00
parent 1d18472297
commit 94e81966be
5 changed files with 891 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:e2e": "vitest run --config vitest.e2e.config.ts"
},
"dependencies": {
@@ -28,6 +29,7 @@
},
"devDependencies": {
"@types/node": "^20.19.0",
"@vitest/coverage-v8": "^3.2.7",
"typescript": "^5.8.0",
"vitest": "^3.2.0"
}