Skip to content

Commit 2364758

Browse files
committed
fix(ci): align coverage thresholds in test workflow with vitest.config.js
The GitHub Actions workflow was using a hardcoded 80% threshold for all coverage metrics, while vitest.config.js uses lower thresholds (45% lines, 60% functions, 75% branches). Updated workflow to use the same thresholds. https://claude.ai/code/session_014wRFPM6aseKKcCMGhC9WRE
1 parent 08219ae commit 2364758

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,26 @@ jobs:
5555
console.log('Branches:', total.branches.pct + '%');
5656
console.log('Statements:', total.statements.pct + '%');
5757
58-
const minCoverage = 80;
59-
if (total.lines.pct < minCoverage || total.functions.pct < minCoverage ||
60-
total.branches.pct < minCoverage || total.statements.pct < minCoverage) {
61-
console.log('❌ Coverage below threshold (' + minCoverage + '%)');
58+
// Thresholds matching vitest.config.js
59+
const thresholds = { lines: 45, functions: 60, branches: 75, statements: 45 };
60+
let failed = false;
61+
if (total.lines.pct < thresholds.lines) {
62+
console.log('❌ Lines coverage (' + total.lines.pct + '%) below threshold (' + thresholds.lines + '%)');
63+
failed = true;
64+
}
65+
if (total.functions.pct < thresholds.functions) {
66+
console.log('❌ Functions coverage (' + total.functions.pct + '%) below threshold (' + thresholds.functions + '%)');
67+
failed = true;
68+
}
69+
if (total.branches.pct < thresholds.branches) {
70+
console.log('❌ Branches coverage (' + total.branches.pct + '%) below threshold (' + thresholds.branches + '%)');
71+
failed = true;
72+
}
73+
if (total.statements.pct < thresholds.statements) {
74+
console.log('❌ Statements coverage (' + total.statements.pct + '%) below threshold (' + thresholds.statements + '%)');
75+
failed = true;
76+
}
77+
if (failed) {
6278
process.exit(1);
6379
} else {
6480
console.log('✅ Coverage meets threshold requirements');

0 commit comments

Comments
 (0)