Skip to content

armgit / mocha

Public Imported from GitHub
0

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

skip first line of stack trace

Tj Holowaychuk2ea3dc2f7cef
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index 6b54d453..0ad08388 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -94,7 +94,11 @@ exports.list = function(failures){
+ color('error stack', '\n%s\n');
// stack
- var stack = test.err.stack.replace(/^/gm, ' ');
+ var stack = test.err.stack
+ .replace(/^/gm, ' ')
+ .split('\n')
+ .slice(1)
+ .join('\n');
console.log(fmt, i, test.title, test.err.message, stack);
});
};
diff --git a/test/bdd.js b/test/bdd.js
index 80f9817f..3a3198c1 100644
--- a/test/bdd.js
+++ b/test/bdd.js
@@ -9,7 +9,7 @@ describe('Array', function(){
it('should return the correct index when the value is present', function(){
[1,2,3].indexOf(1).should.equal(0);
[1,2,3].indexOf(2).should.equal(1);
- [1,2,3].indexOf(3).should.equal(2);
+ [1,2,3].indexOf(5).should.equal(2);
})
})
})