diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2019-11-05 14:55:08 -0500 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-11-09 20:13:43 -0800 |
commit | 4b97c3addb246274cd7e8432edd537e0bdf60b63 (patch) | |
tree | 9f859239c3b38b04ddc58ee736bf6b2caf6008a5 /deps/npm/test/tap/uninstall-save.js | |
parent | 5f9794ea9aaaf5597974a65460e1f3069f68475f (diff) | |
download | android-node-v8-4b97c3addb246274cd7e8432edd537e0bdf60b63.tar.gz android-node-v8-4b97c3addb246274cd7e8432edd537e0bdf60b63.tar.bz2 android-node-v8-4b97c3addb246274cd7e8432edd537e0bdf60b63.zip |
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/uninstall-save.js')
-rw-r--r-- | deps/npm/test/tap/uninstall-save.js | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/deps/npm/test/tap/uninstall-save.js b/deps/npm/test/tap/uninstall-save.js index 0605616e07..bf1683edca 100644 --- a/deps/npm/test/tap/uninstall-save.js +++ b/deps/npm/test/tap/uninstall-save.js @@ -3,12 +3,10 @@ var path = require('path') var mkdirp = require('mkdirp') var mr = require('npm-registry-mock') -var osenv = require('osenv') var rimraf = require('rimraf') var test = require('tap').test var common = require('../common-tap.js') -var server var pkg = common.pkg @@ -20,10 +18,14 @@ var json = { } test('setup', function (t) { - setup() + mkdirp.sync(path.resolve(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) mr({ port: common.port }, function (er, s) { t.ifError(er, 'started mock registry') - server = s + t.parent.teardown(() => s.close()) t.end() }) }) @@ -68,25 +70,3 @@ test('uninstall --save removes rm-ed package from package.json', function (t) { ) }) }) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} - -function setup () { - cleanup() - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) -} |