diff --git a/bin/cmd.js b/bin/cmd.js index d978228..891db9b 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -16,11 +16,11 @@ var regexTester = require('safe-regex-test'); var jsFile = regexTester(/\.js$/i); var argv = minimist(process.argv.slice(2)); -var tap = faucet({ - width: defined(argv.w, argv.width, process.stdout.isTTY - ? process.stdout.columns - 5 - : 0) -}); +var opts = { + width: defined(argv.w, argv.width, process.stdout.isTTY ? process.stdout.columns - 5 : 0), + stack: defined(argv.stack, process.env.SHOW_STACK ? process.env.SHOW_STACK === 'true' : true) +}; +var tap = faucet(opts); process.on('exit', function (code) { if (code === 0 && tap.exitCode !== 0) { process.exit(tap.exitCode); diff --git a/index.js b/index.js index fde199a..e10cf48 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,9 @@ module.exports = function (opts) { test.ok = false; } push(out, str); - push(test.assertions, res); + if (opts.stack) { + push(test.assertions, res); + } }); tap.on('extra', function (extra) { diff --git a/readme.markdown b/readme.markdown index f9f13db..187db2b 100644 --- a/readme.markdown +++ b/readme.markdown @@ -135,9 +135,10 @@ Once you've got a way to get TAP out of your tests, just pipe into `faucet`: ``` usage: - faucet [FILES] + faucet [FILES] [--no-stack] command | faucet ``` +* the optional ```--no-stack``` argument will remove stack traces from failed test reports # license