Skip to content

Commit

Permalink
Respond to TAP_DEBUG and NODE_DEBUG environs
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 19, 2017
1 parent 7bd7f22 commit 2aa0f21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bin/usage.txt
Expand Up @@ -215,6 +215,10 @@ Environment Variables:

_TAP_COVERAGE_ Reserved for internal use.

TAP_DEBUG Set to '1' to turn on debug mode.

NODE_DEBUG Include 'tap' to turn on debug mode.

Config Files:

You can create a yaml file with any of the options above. By default,
Expand Down
7 changes: 6 additions & 1 deletion lib/tap.js
Expand Up @@ -111,7 +111,12 @@ TAP.prototype.teardown = TAP.prototype.tearDown = function (fn) {
return Test.prototype.teardown.apply(this, arguments)
}

var tap = new TAP({ name: 'TAP' })
var opt = { name: 'TAP' }
if (process.env.TAP_DEBUG === '1' ||
/\btap\b/.test(process.env.NODE_DEBUG || ''))
opt.debug = true

var tap = new TAP(opt)
module.exports = tap
tap.mocha = require('./mocha.js')
tap.mochaGlobals = tap.mocha.global
Expand Down

0 comments on commit 2aa0f21

Please sign in to comment.