Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/browser/_bootstrap.js

Issue 29874649: Issue 6822 - Report browser test errors (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: throw instead of Promise.reject() Created Sept. 21, 2018, 3:39 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/runners/chromium_process.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
});
});
}
« no previous file with comments | « no previous file | test/runners/chromium_process.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld