ospec: don't show null stack trace on timeout

This commit is contained in:
Leo Horie 2016-06-01 01:24:40 -04:00
parent 2e6e1c73d0
commit 0d274ae6ac

View file

@ -187,7 +187,10 @@ module.exports = new function init() {
function report() {
for (var i = 0, r; r = results[i]; i++) {
if (!r.pass) console.error(r.context + ": " + highlight(r.message) + "\n\n" + r.error.match(/^(?:(?!Error|[\/\\]ospec[\/\\]ospec\.js).)*$/m) + "\n\n", hasProcess ? "" : "color:red", hasProcess ? "" : "color:black")
if (!r.pass) {
var stackTrace = r.error.match(/^(?:(?!Error|[\/\\]ospec[\/\\]ospec\.js).)*$/m)
console.error(r.context + ": " + highlight(r.message) + (stackTrace ? "\n\n" + stackTrace + "\n\n" : ""), hasProcess ? "" : "color:red", hasProcess ? "" : "color:black")
}
}
console.log(results.length + " assertions completed in " + Math.round(new Date - start) + "ms")
}