From 114635c6cd906c51d04d2eadc2046aa24e8027c8 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 1 Feb 2017 22:18:58 -0800 Subject: [PATCH] Properly filter out tap dir from stack traces --- lib/stack.js | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/stack.js b/lib/stack.js index e0d32cbbe..827ae3c4f 100644 --- a/lib/stack.js +++ b/lib/stack.js @@ -1,12 +1,14 @@ var StackUtils = require('stack-utils') var path = require('path') +var tapDir = path.resolve(__dirname, '..') // don't skip when developing on tap itself -var skip = __dirname.indexOf(process.cwd()) !== 0 || +var skip = process.cwd() !== tapDir || +process.env.TAP_DEV_SHORTSTACK === 1 && +process.env.TAP_DEV_LONGSTACK !== 1 ? [ /node_modules[\/\\]tap[\/\\]/, + new RegExp(resc(tapDir)), new RegExp(resc(require.resolve('function-loop'))), new RegExp(resc(path.dirname(require.resolve('bluebird/package.json')))), new RegExp(resc(__dirname) + '\\b', 'i') diff --git a/package.json b/package.json index 0cf99e24c..5c26f8f24 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "own-or-env": "^1.0.0", "readable-stream": "^2.0.2", "signal-exit": "^3.0.0", - "stack-utils": "^0.4.0", + "stack-utils": "^1.0.0", "tap-mocha-reporter": "^3.0.1", "tap-parser": "^5.3.1", "tmatch": "^3.0.0",