Skip to content

Commit

Permalink
Use _TAP_COVERAGE_ environ instead of --__coverage__
Browse files Browse the repository at this point in the history
Fix #302
Fix #246

h/t to @martinheidegger for finding the root problem.
  • Loading branch information
isaacs committed Sep 9, 2016
1 parent 9847e19 commit 3235e2c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ var yaml = require('js-yaml')

var coverageServiceTest = process.env.COVERAGE_SERVICE_TEST === 'true'

if (process.env._TAP_COVERAGE_ === '1') {
// NYC will not wrap a module in node_modules.
// So, we need to tell the child proc when it's been added.
global.__coverage__ = global.__coverage__ || {}
}

// console.error(process.argv.join(' '))
// console.error('CST=%j', process.env.COVERAGE_SERVICE_TEST)
// console.error('CRT=%j', process.env.COVERALLS_REPO_TOKEN)
Expand Down Expand Up @@ -236,12 +242,6 @@ function parseArgs (args, defaults) {
console.log(require('../package.json').version)
return null

case '--__coverage__':
// NYC will not wrap a module in node_modules.
// So, we need to tell the child proc when it's been added.
global.__coverage__ = global.__coverage__ || {}
continue

case '--coverage-report':
options.coverageReport = val || args[++i]
if (options.coverageReport === 'html') {
Expand Down Expand Up @@ -402,9 +402,9 @@ function respawnWithCoverage (options) {
options.nycArgs,
'--',
process.execArgv,
process.argv.slice(1),
'--__coverage__'
process.argv.slice(1)
)
process.env._TAP_COVERAGE_ = '1'
var child = fg(node, args)
child.removeAllListeners('close')
child.on('close', function (code, signal) {
Expand Down
2 changes: 2 additions & 0 deletions bin/usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ Environment Variables:
running child tests so that their output
is parseable by the test harness.

_TAP_COVERAGE_ Reserved for internal use.

Config Files:

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

0 comments on commit 3235e2c

Please sign in to comment.