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

View File

@@ -31,6 +31,15 @@ jobs:
- name: Test
run: npm test
- name: Test coverage
if: matrix.node-version == 22
run: |
npm run test:coverage
echo "## Test Coverage" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
npm run test:coverage 2>&1 | grep -A20 'Coverage report' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Type check
run: npx tsc --noEmit