diff --git a/scripts/maketest b/scripts/maketest index 118eb5fbc7dc9..038ae770e2f9c 100755 --- a/scripts/maketest +++ b/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 @@ -48,7 +47,6 @@ const conf = { }) } -let server const fixture = new Tacks(Dir({ cache: Dir(), global: Dir(), @@ -65,16 +63,12 @@ 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) { +test('example', t => { common.npm(['install'], conf, function (err, code, stdout, stderr) { if (err) throw err t.is(code, 0, 'command ran ok') @@ -85,8 +79,8 @@ test('example', function (t) { }) }) -test('cleanup', function (t) { - server.close() +test('cleanup', t => { + common.fakeRegistry.close() cleanup() t.done() })\n`