summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/git-dependency-install-link.js
diff options
context:
space:
mode:
authorRuy Adorno <ruyadorno@hotmail.com>2019-11-05 14:55:08 -0500
committerRich Trott <rtrott@gmail.com>2019-11-09 20:13:43 -0800
commit4b97c3addb246274cd7e8432edd537e0bdf60b63 (patch)
tree9f859239c3b38b04ddc58ee736bf6b2caf6008a5 /deps/npm/test/tap/git-dependency-install-link.js
parent5f9794ea9aaaf5597974a65460e1f3069f68475f (diff)
downloadnode-new-4b97c3addb246274cd7e8432edd537e0bdf60b63.tar.gz
deps: update npm to 6.13.0
PR-URL: https://github.com/nodejs/node/pull/30271 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'deps/npm/test/tap/git-dependency-install-link.js')
-rw-r--r--deps/npm/test/tap/git-dependency-install-link.js41
1 files changed, 17 insertions, 24 deletions
diff --git a/deps/npm/test/tap/git-dependency-install-link.js b/deps/npm/test/tap/git-dependency-install-link.js
index 44438e7f95..d80beab057 100644
--- a/deps/npm/test/tap/git-dependency-install-link.js
+++ b/deps/npm/test/tap/git-dependency-install-link.js
@@ -1,7 +1,6 @@
var fs = require('fs')
var resolve = require('path').resolve
-var osenv = require('osenv')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var test = require('tap').test
@@ -11,9 +10,9 @@ var mr = require('npm-registry-mock')
var npm = require('../../lib/npm.js')
var common = require('../common-tap.js')
-var pkg = common.pkg
-var repo = pkg + '-repo'
-var prefix = pkg + '-prefix'
+var pkg = resolve(common.pkg, 'package')
+var repo = resolve(common.pkg, 'repo')
+var prefix = resolve(common.pkg, 'prefix')
var cache = common.cache
var daemon
@@ -42,8 +41,8 @@ var pjChild = JSON.stringify({
}, null, 2) + '\n'
test('setup', function (t) {
- bootstrap()
- setup(function (er, r) {
+ t.test('bootstrap', t => bootstrap(t.end))
+ t.test('setup', t => setup(function (er, r) {
t.ifError(er, 'git started up successfully')
if (!er) {
@@ -59,7 +58,8 @@ test('setup', function (t) {
t.end()
})
- })
+ }))
+ t.end()
})
test('install from git repo [no --link]', function (t) {
@@ -103,20 +103,20 @@ test('install from git repo [with --link]', function (t) {
test('clean', function (t) {
mockRegistry.close()
- daemon.on('close', function () {
- cleanup()
- t.end()
- })
+ daemon.on('close', t.end)
process.kill(daemonPID)
})
-function bootstrap () {
- rimraf.sync(repo)
- rimraf.sync(pkg)
- mkdirp.sync(pkg)
- mkdirp.sync(cache)
+function bootstrap (cb) {
+ rimraf(repo, () => {
+ rimraf(pkg, () => {
+ mkdirp.sync(pkg)
+ mkdirp.sync(cache)
- fs.writeFileSync(resolve(pkg, 'package.json'), pjParent)
+ fs.writeFileSync(resolve(pkg, 'package.json'), pjParent)
+ cb()
+ })
+ })
}
function setup (cb) {
@@ -170,10 +170,3 @@ function setup (cb) {
}, cb)
})
}
-
-function cleanup () {
- process.chdir(osenv.tmpdir())
- rimraf.sync(repo)
- rimraf.sync(prefix)
- rimraf.sync(pkg)
-}