Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Ensure consistent calculation of duration

FND3e85f89026cc
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index d5425c8a..172d4897 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -304,7 +304,7 @@ function Base (runner) {
runner.on('end', function () {
stats.end = new Date();
- stats.duration = new Date() - stats.start;
+ stats.duration = stats.end - stats.start;
});
runner.on('pending', function () {