Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally it's best to have absence and false be the same - can we invert this to "hideStack" instead?

(altho i do like --no-stack as the CLI arg name)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

};
var tap = faucet(opts);
process.on('exit', function (code) {
if (code === 0 && tap.exitCode !== 0) {
process.exit(tap.exitCode);
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down