From 43dd49c9782848c25e5b03448c8a0f923f13c158 Mon Sep 17 00:00:00 2001 From: Kat Marchán Date: Tue, 29 Jan 2019 14:43:00 -0800 Subject: deps: upgrade npm to 6.7.0 PR-URL: https://github.com/nodejs/node/pull/25804 Reviewed-By: Myles Borins --- deps/npm/scripts/maketest | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'deps/npm/scripts') diff --git a/deps/npm/scripts/maketest b/deps/npm/scripts/maketest index 118eb5fbc7..bf0c2c5f65 100755 --- a/deps/npm/scripts/maketest +++ b/deps/npm/scripts/maketest @@ -24,7 +24,6 @@ function generateFromDir (dir) { return `'use strict' const path = require('path') const test = require('tap').test -const mr = require('npm-registry-mock') const Tacks = require('tacks') const File = Tacks.File const Symlink = Tacks.Symlink @@ -39,7 +38,7 @@ const tmpdir = path.join(basedir, 'tmp') const conf = { cwd: testdir, - env: Object.assign({}, process.env, { + env: common.newEnv().extend({ npm_config_cache: cachedir, npm_config_tmp: tmpdir, npm_config_prefix: globaldir, @@ -48,7 +47,6 @@ const conf = { }) } -let server const fixture = new Tacks(Dir({ cache: Dir(), global: Dir(), @@ -65,28 +63,22 @@ function cleanup () { fixture.remove(basedir) } -test('setup', function (t) { +test('setup', t => { setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) + return common.fakeRegistry.listen() }) -test('example', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err +test('example', t => { + return common.npm(['install'], conf).then((code, stdout, stderr) => { t.is(code, 0, 'command ran ok') t.comment(stdout.trim()) t.comment(stderr.trim()) // your assertions here - t.done() }) }) -test('cleanup', function (t) { - server.close() +test('cleanup', t => { + common.fakeRegistry.close() cleanup() t.done() })\n` -- cgit v1.2.3