Index: test/browser/_bootstrap.js |
=================================================================== |
--- a/test/browser/_bootstrap.js |
+++ b/test/browser/_bootstrap.js |
@@ -41,16 +41,18 @@ |
for (let module of moduleNames) |
tests[module] = nodeunit.testCase(require("./" + module + ".js")); |
return new Promise((resolve, reject) => |
{ |
nodeunit.runModules(tests, { |
moduleStart(name) |
{ |
+ if (typeof window.consoleLogs === "undefined") |
Manish Jethani
2018/09/05 19:47:21
I have nothing against using strict equality where
hub
2018/09/06 01:00:13
Done.
|
+ window.consoleLogs = {failures: 0, log: []}; |
console.log(bold(name)); |
}, |
testDone(name, assertions) |
{ |
let errors = assertions.filter(assertion => assertion.failed()) |
.map(assertion => assertion.error); |
if (errors.length == 0) |
@@ -68,27 +70,28 @@ |
}); |
} |
}, |
done(assertions) |
{ |
let failures = assertions.filter(assertion => assertion.failed()); |
if (failures.length) |
{ |
+ window.consoleLogs.failures += failures.length; |
console.log( |
"\n" + |
bold(error("FAILURES: ")) + |
failures.length + "/" + assertions.length + " assertions failed" |
); |
} |
else |
{ |
console.log( |
"\n" + bold(ok("OK: ")) + |
- assertions.length + " assertions" |
+ assertions.length + " assertions (" + assertions.duration + "ms)" |
); |
} |
resolve(); |
} |
}); |
}); |
} |