Skip to content

Commit 516f89a

Browse files
committed
fix(checkCoverage)
1 parent a864cd5 commit 516f89a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/scripts/checkCoverage.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ const baseline = 95;
1818

1919
const statementsCoverage = (info.coveredStatements / info.statements) * 100;
2020
if (statementsCoverage <= baseline) {
21-
console.log(`Statements is required to be ${baseline}% or higher. Currently ${statementsCoverage.toFixed(2)}`);
22-
process.exit();
21+
throw new Error(`Statements is required to be ${baseline}% or higher. Currently ${statementsCoverage.toFixed(2)}`);
2322
}
2423

2524
const conditionalsCoverage = (info.coveredConditionals / info.conditionals) * 100;
2625
if (conditionalsCoverage <= baseline) {
27-
console.log(`Conditionals is required to be ${baseline}% or higher. Currently ${conditionalsCoverage.toFixed(2)}`);
28-
process.exit();
26+
throw new Error(
27+
`Conditionals is required to be ${baseline}% or higher. Currently ${conditionalsCoverage.toFixed(2)}`
28+
);
2929
}
3030

3131
const methodsCoverage = (info.coveredMethods / info.methods) * 100;
3232
if (methodsCoverage <= baseline) {
33-
console.log(`Methods is required to be ${baseline}% or higher. Currently ${methodsCoverage.toFixed(2)}`);
34-
process.exit();
33+
throw new Error(`Methods is required to be ${baseline}% or higher. Currently ${methodsCoverage.toFixed(2)}`);
3534
}
3635

3736
const combinedCoverage = statementsCoverage + conditionalsCoverage + methodsCoverage;
3837
if (combinedCoverage <= baseline) {
39-
console.log(`Everything Combined is required to be ${baseline}% or higher. Currently ${combinedCoverage.toFixed(2)}`);
40-
process.exit();
38+
throw new Error(
39+
`Everything Combined is required to be ${baseline}% or higher. Currently ${combinedCoverage.toFixed(2)}`
40+
);
4141
}

0 commit comments

Comments
 (0)