ci: add test coverage reporting with v8 provider

- Add vitest.config.ts with v8 coverage provider
- Add npm run test:coverage script
- Add coverage step to CI (Node 22, reports in job summary)
- Coverage tracks src/lib/ utilities (currently ~21% lines)
- Install @vitest/coverage-v8 dev dependency
This commit is contained in:
Nicolas Varrot
2026-02-13 07:27:02 +00:00
parent 41f3952548
commit 0e4ae0ed7f
4 changed files with 175 additions and 0 deletions

16
vitest.config.ts Normal file
View File

@@ -0,0 +1,16 @@
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['src/**/__tests__/**/*.test.{ts,tsx}'],
coverage: {
provider: 'v8',
reporter: ['text', 'text-summary', 'json-summary'],
include: ['src/lib/**/*.ts'],
exclude: ['src/lib/__tests__/**'],
// Thresholds intentionally unset — coverage is tracked, not enforced yet.
},
},
})