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") |
+ 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,27 @@ |
}); |
} |
}, |
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" |
+ `\n ${bold(ok("OK: "))}${assertions.length} assertions (${assertions.duration}ms)` |
); |
} |
resolve(); |
} |
}); |
}); |
} |