Skip to content

Commit 0e2dfda

Browse files
committed
Fix test/test-options when run through npm test.
`npm test` dumps a ton of npm_config_* variables in the environment. Remove those before starting the actual test. PR-URL: #755 Reviewed-By: Rod Vagg <[email protected]>
1 parent 9bfa087 commit 0e2dfda

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/test-options.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ var gyp = require('../lib/node-gyp')
66
test('options in environment', function (t) {
77
t.plan(1)
88

9+
// `npm test` dumps a ton of npm_config_* variables in the environment.
10+
Object.keys(process.env)
11+
.filter(function(key) { return /^npm_config_/.test(key) })
12+
.forEach(function(key) { delete process.env[key] })
13+
914
// Zero-length keys should get filtered out.
1015
process.env.npm_config_ = '42'
1116
// Other keys should get added.

0 commit comments

Comments
 (0)