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: Updated patch Created Sept. 18, 2018, 10:23 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') | test_runner.js » ('J')
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,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)"
Sebastian Noack 2018/09/19 08:16:51 Nit: Perhaps use a template string here.
hub 2018/09/20 00:19:56 Done.
);
}
resolve();
}
});
});
}
« no previous file with comments | « no previous file | test/runners/chromium_process.js » ('j') | test_runner.js » ('J')

Powered by Google App Engine
This is Rietveld