From aaaf6f7d407a54361cfde3aa4401e35d4572e39e Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 1 Feb 2017 22:24:38 -0800 Subject: [PATCH] Document TAP_DEV_LONGSTACK/SHORTSTACK environs Also, no need to exclude both the lib dir and the tap dir, since they're the same thing. --- bin/usage.txt | 12 ++++++++++++ lib/stack.js | 5 ++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/usage.txt b/bin/usage.txt index 759e97488..42489cd9b 100644 --- a/bin/usage.txt +++ b/bin/usage.txt @@ -195,6 +195,18 @@ Environment Variables: TAP_BUFFER Set to '1' to run subtests in buffered mode by default. + TAP_DEV_LONGSTACK Set to '1' to include node-tap internals + in stack traces. By default, these are + included only when the current working + directory is the tap project itself. + Note that node internals are always + excluded. + + TAP_DEV_SHORTSTACK Set to '1' to exclude node-tap internals + in stack traces, even if the current + working directory is the tap project + itself. + _TAP_COVERAGE_ Reserved for internal use. Config Files: diff --git a/lib/stack.js b/lib/stack.js index 827ae3c4f..17665a492 100644 --- a/lib/stack.js +++ b/lib/stack.js @@ -8,10 +8,9 @@ var skip = process.cwd() !== tapDir || +process.env.TAP_DEV_LONGSTACK !== 1 ? [ /node_modules[\/\\]tap[\/\\]/, - new RegExp(resc(tapDir)), + new RegExp(resc(tapDir) + '\\b', 'i'), new RegExp(resc(require.resolve('function-loop'))), - new RegExp(resc(path.dirname(require.resolve('bluebird/package.json')))), - new RegExp(resc(__dirname) + '\\b', 'i') + new RegExp(resc(path.dirname(require.resolve('bluebird/package.json')))) ] : []