Skip to content

Add a documented vitest coverage threshold gate for the frontend src directory #809

Description

@1nonlypiece

📌 Description

The repo runs Vitest with v8 coverage and a coverage CI workflow
(.github/workflows/coverage.yml, docs/coverage-ci.md), but vitest.config.ts
does not enforce explicit per-metric thresholds for the frontend src/ tree.
Without enforced thresholds, coverage can silently erode below the project's
stated 95% expectation.

This issue adds documented coverage thresholds to the Vitest config so CI fails
when coverage drops.

Goal: enforce statement/branch/function/line coverage thresholds in
vitest.config.ts and document them.

🎯 Requirements and Context

  • Add coverage.thresholds to vitest.config.ts at a level consistent with the
    project's stated bar.
  • Scope includes/excludes sensibly (exclude generated/config/test files).
  • Document the policy and how to run coverage locally in docs/coverage-ci.md.
  • Ensure the existing coverage workflow respects the thresholds.

🛠️ Suggested Execution

1. Fork the repo and create a branch

git checkout -b enhancement/coverage-thresholds

2. Implement changes

  • Add thresholds to vitest.config.ts.
  • Update docs/coverage-ci.md.

3. Test and commit

  • Run pnpm test:coverage to confirm thresholds apply and pass.

Example commit message

ci: enforce vitest coverage thresholds for src

✅ Guidelines

  • Minimum 95% test coverage on any new/changed logic.
  • CI fails when coverage drops below threshold.
  • Timeframe: 96 hours.

🏷️ Labels

type-enhancement · type-documentation · area-frontend · MAYBE REWARDED · GRANTFOX OSS · OFFICIAL CAMPAIGN

💬 Community & Support

  • Join the CommitLabs contributor Discord to coordinate, ask questions, and get
    unblocked fast: https://discord.gg/WV7tdYkJk
  • Please introduce yourself in the channel before you start so we can avoid
    duplicate work, pair you with a reviewer, and get your PR merged quickly.
  • Maintainers actively triage this channel and aim for fast, clear, respectful
    reviews — reach out any time you're blocked.

Metadata

Metadata

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions