Skip to content

Add coverage thresholds to CI to prevent untested code from merging #73

Description

@nanaf6203-bit

Area: Testing Quality
Priority: P1 — High

Description

Tests might pass without actually exercising important code paths. Coverage thresholds in CI enforce a measurable floor on quality.

Acceptance Criteria

  • Update package.json jest config with coverageThreshold:
    • branches: 80
    • functions: 85
    • lines: 85
    • statements: 85
  • CI fails if any metric drops below threshold
  • Coverage report uploaded to Codecov (or Coveralls) with token from secrets
  • Coverage badge in README (shields.io or codecov.io)
  • Exclude generated files, test files, DTOs, and entity definitions from coverage
  • Document threshold rationale and exceptions in CONTRIBUTING.md

Technical Notes

  • Use jest --coverage --coverageReporters=text-summary json lcov
  • Codecov action: codecov/codecov-action@v4
  • coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '.*\\.dto\\.ts$', '.*\\.entity\\.ts$']

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions