fix: _ in npm_config_ env variables

This commit is contained in:
Cheng Zhao 2021-11-08 11:26:57 +09:00 committed by Rod Vagg
parent a32a9aa8e6
commit eef4eefccb
3 changed files with 17 additions and 1 deletions

View file

@ -29,3 +29,14 @@ test('options in environment', (t) => {
t.deepEqual(Object.keys(g.opts).sort(), keys.sort())
})
test('options with spaces in environment', (t) => {
t.plan(1)
process.env.npm_config_force_process_config = 'true'
const g = gyp()
g.parseArgv(['rebuild']) // Also sets opts.argv.
t.equal(g.opts['force-process-config'], 'true')
})