-
Notifications
You must be signed in to change notification settings - Fork 0
Implement test coverage reporting #16
Open
Assignees
Description
Add Vitest coverage reporting so we can see how much of the codebase the tests exercise.
π§ Context
The project uses Vitest (pnpm test β vitest run). Coverage is not enabled. Vitest has built-in coverage (the equivalent of pytest-cov) via a provider package.
The goal here is reporting only β print a coverage summary and generate an HTML report. Do not add an enforced threshold that fails the build. The test suite is still small, so a hard gate would just block PRs; a threshold can be added later once coverage is meaningful.
π οΈ Implementation Plan
- Install the coverage provider:
pnpm add -D @vitest/coverage-v8(the default V8 provider β fast, native). This repo has security settings inpnpm-workspace.yaml; if the install is blocked by a policy error, flag it to Jacc rather than working around it. - Add a
test:coveragescript topackage.json:vitest run --coverage. - Configure coverage in
vite.config.tsundertest.coverage:provider: 'v8'reporter: ['text', 'html'](terminal summary + an HTML report)- sensible
excludes:src/main.tsx,**/*.test.ts, config files (*.config.*), type-only files (src/types/**), and the test setup. - No thresholds.
- Run
pnpm test:coverageand confirm it prints a summary table and writes the HTML report. - Add the coverage output directory (e.g.
coverage/) to.gitignore. (This also keeps it out ofprettier/eslint, which respect.gitignore.) - Before pushing, run
pnpm formatthenpnpm typecheck,pnpm lint,pnpm format:check, andpnpm testβ CI now gates on all of these, so yourvite.config.ts/package.jsonedits must be formatted.
π« Out of scope (stretch / later)
- Wiring coverage into CI (
.github/workflows/ci.yml) and uploading an lcov artifact β a reasonable stretch goal, but keep the first PR to local reporting unless you want to take it on. - Enforced coverage thresholds β stick to report-only for now. We don't want CI immediately breaking.
β Acceptance Criteria
-
pnpm test:coverageruns and prints a coverage summary in the terminal -
@vitest/coverage-v8is added as a devDependency -
test.coverageis configured invite.config.tswith sensible excludes - No enforced threshold (reporting only)
- The coverage output directory is gitignored
-
pnpm typecheck,pnpm lint,pnpm format:check, andpnpm testall pass
Metadata
Metadata
Assignees
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
In Progress