diff options
author | npm team <ops+robot@npmjs.com> | 2021-08-19 20:47:33 +0300 |
---|---|---|
committer | Luigi Pinca <luigipinca@gmail.com> | 2021-08-20 15:53:49 +0300 |
commit | 248f4c376444d0202f1d08f039c59485d6aea2e9 (patch) | |
tree | 270bcf6dd5734fa43ea1603bfc4a066b6f8f7926 /deps/npm/test/lib/prefix.js | |
parent | 279162cf98b22ec5d0afc182ea22c7a782ccd083 (diff) |
deps: upgrade npm to 7.21.0
PR-URL: https://github.com/nodejs/node/pull/39813
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/npm/test/lib/prefix.js')
-rw-r--r-- | deps/npm/test/lib/prefix.js | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/deps/npm/test/lib/prefix.js b/deps/npm/test/lib/prefix.js index 526631388e7..18a37f3ccd1 100644 --- a/deps/npm/test/lib/prefix.js +++ b/deps/npm/test/lib/prefix.js @@ -1,19 +1,13 @@ const t = require('tap') +const { real: mockNpm } = require('../fixtures/mock-npm') -t.test('prefix', (t) => { - t.plan(3) - const dir = '/prefix/dir' - - const Prefix = require('../../lib/prefix.js') - const prefix = new Prefix({ - prefix: dir, - output: (output) => { - t.equal(output, dir, 'prints the correct directory') - }, - }) - - prefix.exec([], (err) => { - t.error(err, 'npm prefix') - t.ok('should have printed directory') - }) +t.test('prefix', async (t) => { + const { joinedOutput, command, npm } = mockNpm(t) + await npm.load() + await command('prefix') + t.equal( + joinedOutput(), + npm.prefix, + 'outputs npm.prefix' + ) }) |