| 1 |
const config = JSON.parse(process.env.NYC_CONFIG) |
| 2 |
const { include } = config |
| 3 |
|
| 4 |
if (process.argv[2] !== 'child') { |
| 5 |
console.log('in parent', { include }) |
| 6 |
require('child_process').spawn(process.execPath, [__filename, 'child'], { |
| 7 |
cwd: __dirname, |
| 8 |
env: Object.assign( |
| 9 |
{}, |
| 10 |
process.env, |
| 11 |
{ |
| 12 |
NYC_CONFIG_OVERRIDE: JSON.stringify({ |
| 13 |
include: 'conf-override-module.js' |
| 14 |
}) |
| 15 |
} |
| 16 |
), |
| 17 |
stdio: 'inherit', |
| 18 |
}) |
| 19 |
} else { |
| 20 |
// this should run, but not be covered, even though the shebang says to |
| 21 |
// the child run ONLY covers the child file, not the dump-root.js |
| 22 |
console.log('in child', { include }) |
| 23 |
require('./conf-override-module.js') |
| 24 |
} |