Skip to content

Commit

Permalink
Only calc diff if base > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mlafleur committed Nov 28, 2023
1 parent 4b94fff commit 573cce8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ async function generateMarkdown(
? baseCoverage.files[hash].coverage
: 0

const differencePercentage = baseCoveragePercentage
? roundPercentage(file.coverage - baseCoveragePercentage)
: roundPercentage(file.coverage)
const differencePercentage =
baseCoveragePercentage > 0
? roundPercentage(file.coverage - baseCoveragePercentage)
: roundPercentage(file.coverage)

if (
failOnNegativeDifference &&
Expand Down

0 comments on commit 573cce8

Please sign in to comment.