Skip to content

Commit

Permalink
Round coverage percentage down.
Browse files Browse the repository at this point in the history
The HTML coverage reporter can show coverage less than 100% as "100".
This patch will round fractional values down to avoid confusion.
For example:
  ((275/276) * 100).toFixed(0) == "100"
  Math.floor((275/276) * 100).toFixed(0) == "99"
  • Loading branch information
davidlehn authored and indexzero committed Nov 22, 2014
1 parent acbb20a commit 9ee52a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vows/coverage/report-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ this.report = function (coverageMap) {
}
}

summary.coverage = (summary.hits / summary.sloc) * 100;
summary.coverage = Math.floor((summary.hits / summary.sloc) * 100);

fs.writeSync(out, '<h1 id="overview">Coverage</h1><div id="menu">');

Expand Down

0 comments on commit 9ee52a7

Please sign in to comment.