bcgov / bcgov/lcfs

LCFS - Enable and enforce test coverage thresholds

Open
#4,094 0 comments 0 reactions 1 assignee Claimed by @AlexZorkin View on GitHub
javascript Medium Task
Dominant language
Python
Stars
6
Forks
6
Avg merge
2d 4h
Merged PRs (30d)
87

Description

**Describe the task**
The Vitest coverage configuration in `vite.config.ts` has coverage thresholds commented out. Enable minimum coverage thresholds and address any modules that fall below the threshold.

**Purpose**
Without enforced thresholds, test coverage can silently regress as new code is added without tests. Enabling thresholds in CI prevents coverage decay.

**Acceptance Criteria**
- [ ] Run current coverage report and document baseline metrics
- [ ] Set reasonable initial thresholds (e.g., 60% statements, 50% branches)
- [ ] Uncomment and configure coverage thresholds in `vite.config.ts`
- [ ] Ensure CI fails when coverage drops below thresholds
- [ ] Document coverage goals and plan for incremental increases

**Additional context**
- Coverage provider: v8
- Current exclusions: `src/*.{jsx,js,tsx,ts}`, `src/assets`, `src/constants`, `src/themes`, `src/tests`
- Coverage report format: HTML

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.