Skip to content
Browse files

fixed percentage display.. now floors instead of rounds

  • Loading branch information...
1 parent 1e23a63 commit 8235783109ceca8cf7bd90bf4edf9b0a1a20bc9a @tmpvar committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/runner.js
View
6 lib/runner.js
@@ -104,7 +104,7 @@ exports.run = function(testSuites) {
if (args.suite) {
sys.puts(" ");
- sys.puts(errors.length + " of " + total + " failed (" + Math.round(((total-errors.length)/total)*100) + "% success)" );
+ sys.puts(errors.length + " of " + total + " failed (" + Math.floor(((total-errors.length)/total)*100) + "% success)" );
sys.puts(" ");
} else {
var numerator, denominator, percent;
@@ -122,7 +122,7 @@ exports.run = function(testSuites) {
if (testSuites.hasOwnProperty(suiteName)) {
numerator = testSuites[suiteName].total - testSuites[suiteName].errors.length;
denominator = testSuites[suiteName].total;
- percent = Math.round((numerator / denominator)*100,2) || 0;
+ percent = Math.floor((numerator / denominator)*100) || 0;
sys.puts(padName(suiteName) + "\t" + numerator + "/" + denominator + "\t\t" + percent + "% passing");
}
}
@@ -130,7 +130,7 @@ exports.run = function(testSuites) {
sys.puts("--------------------------------------------");
numerator = total-errors.length;
denominator = total;
- percent = Math.round((numerator / denominator)*100,2) || 0;
+ percent = Math.floor((numerator / denominator)*100) || 0;
sys.puts("TOTALS:\t\t" + numerator + "/" + denominator + "\t" + percent + "% passing\r\n");
}
};

0 comments on commit 8235783

Please sign in to comment.
Something went wrong with that request. Please try again.