Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Fixed `Base#list()` index reporting

Tj Holowaychukc84d68273da2
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index b4db7849..a9319db5 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -95,11 +95,11 @@ exports.list = function(failures){
// msg
var stack = test.err.stack
- , i = stack.indexOf('at')
- , msg = stack.slice(0, i);
+ , index = stack.indexOf('at')
+ , msg = stack.slice(0, index);
// indent stack trace without msg
- stack = stack.slice(i)
+ stack = stack.slice(index)
.replace(/^/gm, ' ');
console.log(fmt, i, test.title, msg, stack);