summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/git-cache-locking.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/test/tap/git-cache-locking.js')
-rw-r--r--deps/npm/test/tap/git-cache-locking.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/deps/npm/test/tap/git-cache-locking.js b/deps/npm/test/tap/git-cache-locking.js
index e08c96e1b7..29ab5709b9 100644
--- a/deps/npm/test/tap/git-cache-locking.js
+++ b/deps/npm/test/tap/git-cache-locking.js
@@ -6,6 +6,7 @@ var mkdirp = require('mkdirp')
var pkg = path.resolve(__dirname, 'git-cache-locking')
var tmp = path.join(pkg, 'tmp')
var cache = path.join(pkg, 'cache')
+var shallowClone = Object.assign || require('util')._extend
test('setup', function (t) {
rimraf.sync(pkg)
@@ -17,6 +18,12 @@ test('git-cache-locking: install a git dependency', function (t) {
// disable git integration tests on Travis.
if (process.env.TRAVIS) return t.end()
+ var gitEnv = shallowClone({}, process.env)
+ gitEnv.npm_config_cache = cache
+ gitEnv.npm_config_tmp = tmp
+ gitEnv.npm_config_prefix = pkg
+ gitEnv.npm_config_global = 'false'
+
// package c depends on a.git#master and b.git#master
// package b depends on a.git#master
common.npm([
@@ -24,17 +31,9 @@ test('git-cache-locking: install a git dependency', function (t) {
'git://github.com/nigelzor/npm-4503-c.git'
], {
cwd: pkg,
- env: {
- npm_config_cache: cache,
- npm_config_tmp: tmp,
- npm_config_prefix: pkg,
- npm_config_global: 'false',
- HOME: process.env.HOME,
- Path: process.env.PATH,
- PATH: process.env.PATH
- }
+ env: gitEnv
}, function (err, code, stdout, stderr) {
- t.ifErr(err, 'npm install finished without error')
+ if (err) throw err
t.equal(0, code, 'npm install should succeed')
t.end()
})