Skip to content

Commit 2aa0f21

Browse files
committed
Respond to TAP_DEBUG and NODE_DEBUG environs
1 parent 7bd7f22 commit 2aa0f21

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

bin/usage.txt

+4
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ Environment Variables:
215215

216216
_TAP_COVERAGE_ Reserved for internal use.
217217

218+
TAP_DEBUG Set to '1' to turn on debug mode.
219+
220+
NODE_DEBUG Include 'tap' to turn on debug mode.
221+
218222
Config Files:
219223

220224
You can create a yaml file with any of the options above. By default,

lib/tap.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ TAP.prototype.teardown = TAP.prototype.tearDown = function (fn) {
111111
return Test.prototype.teardown.apply(this, arguments)
112112
}
113113

114-
var tap = new TAP({ name: 'TAP' })
114+
var opt = { name: 'TAP' }
115+
if (process.env.TAP_DEBUG === '1' ||
116+
/\btap\b/.test(process.env.NODE_DEBUG || ''))
117+
opt.debug = true
118+
119+
var tap = new TAP(opt)
115120
module.exports = tap
116121
tap.mocha = require('./mocha.js')
117122
tap.mochaGlobals = tap.mocha.global

0 commit comments

Comments
 (0)