diff options
author | Rebecca Turner <me@re-becca.org> | 2018-12-19 23:17:28 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2018-12-20 00:35:20 +0300 |
commit | f1edffba90ebd96cf88675d2e18ebc48954ba50e (patch) | |
tree | fac689fec6d76fa2aad258f31de11a50a095ab6c /scripts | |
parent | fb3bbb72d448ac37a465b31233b21381917422f3 (diff) |
scripts: Modernize maketest
Credit: @iarna
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/maketest | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/scripts/maketest b/scripts/maketest index 118eb5fbc..038ae770e 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` |