Skip to content

Add Jest coverage thresholds (soft gate) #4

@ewilderj

Description

@ewilderj

Description

Configure Jest coverage thresholds to ensure code quality standards are maintained and provide a "soft gate" for future development.

Work Required

  1. Update Jest Config: Modify jest.config.js to add coverageThreshold configuration
  2. Set Initial Thresholds: Configure reasonable thresholds based on current coverage levels
  3. Test Configuration: Verify thresholds work correctly and fail builds appropriately
  4. Document Process: Add comments explaining threshold rationale

Implementation Details

Current coverage status (~39% statements according to TODO.md):

  • Set initial thresholds that won't break current builds
  • Configure global thresholds as a starting point for improvement
  • Make thresholds adjustable as coverage improves over time

Proposed Thresholds

coverageThreshold: {
  global: {
    statements: 60,
    branches: 50,
    functions: 55,
    lines: 60
  }
}

Considerations

  • Should be achievable with current test improvements in the pipeline
  • Can be gradually increased as more tests are added
  • Should fail build when thresholds are not met
  • Consider per-file thresholds for critical modules later

Files to Modify

  • jest.config.js - Add coverageThreshold configuration

Testing

  • Run npm test to verify thresholds work
  • Temporarily lower thresholds to test failure behavior
  • Ensure coverage reports show threshold status

Acceptance Criteria

  • Build fails if coverage thresholds are not met
  • Thresholds are reasonable for current codebase state
  • Configuration is properly documented with rationale
  • Coverage reports show threshold status clearly
  • Thresholds can be gradually increased as coverage improves

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions