diff --git a/lib/utils.js b/lib/utils.js index 5c292479b7..cc84a07631 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -663,10 +663,6 @@ exports.stackTraceFilter = function() { ? process.cwd() + slash : (typeof location === 'undefined' ? window.location : location).href.replace(/\/[^\/]*$/, '/'); - function isNodeModule (line) { - return (~line.indexOf('node_modules')); - } - function isMochaInternal (line) { return (~line.indexOf('node_modules' + slash + 'mocha')) || (~line.indexOf('components' + slash + 'mochajs')) || @@ -692,9 +688,7 @@ exports.stackTraceFilter = function() { stack = stack.split('\n'); stack = exports.reduce(stack, function(list, line) { - if (is.node && (isNodeModule(line) || - isMochaInternal(line) || - isNodeInternal(line))) + if (is.node && (isMochaInternal(line) || isNodeInternal(line))) return list; if (is.browser && (isBrowserModule(line))) diff --git a/test/integration/helpers.js b/test/integration/helpers.js index eea8b185fb..7187d9d7e7 100644 --- a/test/integration/helpers.js +++ b/test/integration/helpers.js @@ -98,7 +98,7 @@ module.exports = { // Ignore empty lines before/after diff return diffs.map(function(diff) { - return diff.slice(1, -1).join('\n'); + return diff.slice(1, -2).join('\n'); }); } }; diff --git a/test/utils.js b/test/utils.js index 524a0e0519..31b49893ca 100644 --- a/test/utils.js +++ b/test/utils.js @@ -97,7 +97,8 @@ describe('utils', function() { , 'next (/usr/local/lib/node_modules/mocha/lib/runner.js:248:23)' , 'Immediate._onImmediate (/usr/local/lib/node_modules/mocha/lib/runner.js:276:5)' , 'at processImmediate [as _immediateCallback] (timers.js:321:17)']; - filter(stack.join('\n')).should.equal(stack.slice(0,2).concat(stack.slice(5,7)).join('\n')); + + filter(stack.join('\n')).should.equal(stack.slice(0,7).join('\n')); }); it('should ignore bower and components files', function() {