File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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');
You can’t perform that action at this time.
0 commit comments