Report failures to the console
This commit is contained in:
+16
-1
@@ -46,7 +46,22 @@
|
|||||||
if (window.mochaPhantomJS) {
|
if (window.mochaPhantomJS) {
|
||||||
mochaPhantomJS.run();
|
mochaPhantomJS.run();
|
||||||
} else {
|
} else {
|
||||||
mocha.run();
|
var runner = mocha.run();
|
||||||
|
if (window.console && console.log) {
|
||||||
|
// write stacks to the console for failed tests
|
||||||
|
runner.on('fail', function(test, err) {
|
||||||
|
if (test.duration > test._timeout) {
|
||||||
|
var titles = [];
|
||||||
|
for (var p = test; p; p = p.parent) {
|
||||||
|
if (p.title) {
|
||||||
|
titles.unshift(p.title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('Test timed out:', titles.join(' > '));
|
||||||
|
}
|
||||||
|
console.error(test.err.stack);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
Reference in New Issue
Block a user