Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit c6664b2

Browse files
author
williamd5
authored
Merge branch 'main' into feature/callbacks
2 parents e46cfcd + cf8acce commit c6664b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/generateReadme.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ const testsResult = await new Promise((resolve, reject) => {
3838
// Get coverage percentage
3939
const output = data.join("");
4040
const coverage = (output.match(/----(?:\n|.)+/g) ?? []).pop() ?? "";
41-
const percentages = coverage.match(/All files\s*?\|\s*?(\d+)\s*?\|\s*?(\d+)\s*?\|\s*?(\d+)\s*?\|\s*?(\d+)\s*?/) ?? [];
42-
const averageCoverage = percentages.slice(1).reduce((a, b) => a + parseInt(b, 10), 0) / 4;
41+
const percentages = coverage.match(/All files\s*?\|\s*?([\d.]+)\s*?\|\s*?([\d.]+)\s*?\|\s*?([\d.]+)\s*?\|\s*?([\d.]+)\s*?/) ?? [];
42+
const averageCoverage = Math.round(percentages.slice(1).reduce((a, b) => a + Number.parseFloat(b), 0) / 4);
4343
resolve({coverage: averageCoverage, testsPass: code === 0});
4444
});
4545
});
4646

4747
/**
4848
* Coverage colors
4949
*/
50-
const coverageColors = ["16a34a", "84cc16", "eab308", "f59e0b", "f97316", "ef4444"];
50+
const coverageColors = ["16a34a", "ca8a04", "f97316", "ef4444", "b91c1c"];
5151

5252
/**
5353
* Determine if the build passes by the exit code of `npm run build`

0 commit comments

Comments
 (0)