1 | 'use strict'
|
2 |
|
3 | const test = require('tap').test
|
4 | const gyp = require('../lib/node-gyp')
|
5 |
|
6 | test('options in environment', function (t) {
|
7 | t.plan(1)
|
8 |
|
9 |
|
10 | Object.keys(process.env)
|
11 | .filter(function (key) { return /^npm_config_/.test(key) })
|
12 | .forEach(function (key) { delete process.env[key] })
|
13 |
|
14 |
|
15 | process.env.npm_config_ = '42'
|
16 |
|
17 | process.env.npm_config_x = '42'
|
18 |
|
19 | process.env.npm_config_loglevel = 'debug'
|
20 |
|
21 | var g = gyp()
|
22 | g.parseArgv(['rebuild'])
|
23 |
|
24 | t.deepEqual(Object.keys(g.opts).sort(), ['argv', 'x'])
|
25 | })
|