Skip to content

Commit

Permalink
fix: fix generated code coverage result percent
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Oct 1, 2024
1 parent 9fd7a1c commit 446586b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export const mapTestResults = <T extends Failures | Successes>(testResults: T[])
}));

export const generateCoveredLines = (cov: CodeCoverage): [number[], number[]] => {
const [lineCount, uncoveredLineCount] = getCoverageNumbers(cov);
const [lineCount] = getCoverageNumbers(cov);
const uncoveredLines = ensureArray(cov.locationsNotCovered).map((location) => parseInt(location.line, 10));
const minLineNumber = uncoveredLines.length ? Math.min(...uncoveredLines) : 1;
const lines = [...Array(lineCount + uncoveredLineCount).keys()].map((i) => i + minLineNumber);
const lines = [...Array(lineCount).keys()].map((i) => i + minLineNumber);
const coveredLines = lines.filter((line) => !uncoveredLines.includes(line));
return [uncoveredLines, coveredLines];
};
Expand Down

0 comments on commit 446586b

Please sign in to comment.