Skip to content

Commit 8af10bd

Browse files
authored
refactor(ci): add vitest coverage threshold gate to CI pipeline (JhaSourav07#469)
## Description Fixes JhaSourav07#401 ## Pillar - [ ] 🎨 Pillar 1 β€” New Theme Design - [ ] πŸ“ Pillar 2 β€” Geometric SVG Improvement - [ ] πŸ• Pillar 3 β€” Timezone Logic Optimization - [x] πŸ› οΈ Other (Bug fix, refactoring, docs) ## Visual Preview N/A β€” this is a CI/config change, no SVG output affected. ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [ ] I have updated `README.md` if I added a new theme or URL parameter. - [x] I have started the repo. - [x] I have made sure that i have only one commit to merge in this PR. - [ ] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [ ] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support. ## Test Coverage Results | Metric | Coverage | Threshold | |------------|----------|-----------| | Statements | 86.45% | 70% βœ… | | Branches | 72.93% | 70% βœ… | | Functions | 85.44% | 70% βœ… | | Lines | 88.85% | 70% βœ… | 235 tests passing across 17 test files.
2 parents 9d4694c + 0090b54 commit 8af10bd

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: npm run typecheck
3535

3636
- name: Run Unit Tests (Vitest)
37-
run: npm run test
37+
run: npm run test:coverage
3838

3939
build:
4040
name: Production Build

β€Žvitest.config.tsβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ export default defineConfig({
77
globals: true,
88
include: ['**/*.test.ts', '**/*.test.tsx'],
99
exclude: ['node_modules', '.next'],
10+
coverage: {
11+
provider: 'v8',
12+
reporter: ['text', 'lcov'],
13+
thresholds: {
14+
statements: 70,
15+
branches: 70,
16+
functions: 70,
17+
lines: 70,
18+
},
19+
},
1020
},
1121
resolve: {
1222
alias: {

0 commit comments

Comments
Β (0)