Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Fixed funky highlighting of messages. Closes #97

Tj Holowaychuk7f152567f1ec
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index 6b0b28ae..72b390a1 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -114,12 +114,13 @@ exports.list = function(failures){
+ color('error stack', '\n%s\n');
// msg
- var stack = test.err.stack
- , index = stack.indexOf('at')
+ var err = test.err
+ , stack = err.stack
+ , index = stack.indexOf(err.message) + err.message.length
, msg = stack.slice(0, index);
// indent stack trace without msg
- stack = stack.slice(index)
+ stack = stack.slice(index + 1)
.replace(/^/gm, ' ');
console.error(fmt, i, test.fullTitle(), msg, stack);