Problem
vitest.config.ts configures coverage with provider: 'v8' and thresholds of 80% for statements, branches, functions, and lines. However @vitest/coverage-v8 is not present in devDependencies, and package.json has no coverage script. Running coverage today fails because the provider is not installed, so the configured thresholds are never enforced and are effectively dead configuration.
What needs to be done
- Add
@vitest/coverage-v8 to devDependencies at a version matching the installed Vitest.
- Add a
test:coverage script (for example vitest run --coverage).
- Run coverage and confirm the report is produced.
- The configured 80% thresholds will likely fail against current coverage. Either lower the thresholds to a realistic starting baseline and raise them over time, or scope thresholds to well-covered directories. Document the decision in the PR.
Files
package.json
vitest.config.ts
Acceptance deliverables
npm run test:coverage runs and emits text/json/html reports.
- Thresholds reflect a baseline the suite actually meets, so the command is usable in CI.
Tests to pass
npm run test:coverage exits successfully.
Problem
vitest.config.tsconfigures coverage withprovider: 'v8'and thresholds of 80% for statements, branches, functions, and lines. However@vitest/coverage-v8is not present indevDependencies, andpackage.jsonhas no coverage script. Running coverage today fails because the provider is not installed, so the configured thresholds are never enforced and are effectively dead configuration.What needs to be done
@vitest/coverage-v8todevDependenciesat a version matching the installed Vitest.test:coveragescript (for examplevitest run --coverage).Files
package.jsonvitest.config.tsAcceptance deliverables
npm run test:coverageruns and emits text/json/html reports.Tests to pass
npm run test:coverageexits successfully.