diff options
Diffstat (limited to 'deps/npm/test/lib/help.js')
-rw-r--r-- | deps/npm/test/lib/help.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/deps/npm/test/lib/help.js b/deps/npm/test/lib/help.js index 40a0354210b..fc4a32e07be 100644 --- a/deps/npm/test/lib/help.js +++ b/deps/npm/test/lib/help.js @@ -101,20 +101,13 @@ test('npm help completion', async t => { t.teardown(() => { globErr = null }) - const completion = (opts) => new Promise((resolve, reject) => { - help.completion(opts, (err, res) => { - if (err) - return reject(err) - return resolve(res) - }) - }) - const noArgs = await completion({ conf: { argv: { remain: [] } } }) + const noArgs = await help.completion({ conf: { argv: { remain: [] } } }) t.strictSame(noArgs, ['help', 'whoami', 'npmrc', 'disputes'], 'outputs available help pages') - const threeArgs = await completion({ conf: { argv: { remain: ['one', 'two', 'three'] } } }) + const threeArgs = await help.completion({ conf: { argv: { remain: ['one', 'two', 'three'] } } }) t.strictSame(threeArgs, [], 'outputs no results when more than 2 args are provided') globErr = new Error('glob failed') - t.rejects(completion({ conf: { argv: { remain: [] } } }), /glob failed/, 'glob errors propagate') + t.rejects(help.completion({ conf: { argv: { remain: [] } } }), /glob failed/, 'glob errors propagate') }) test('npm help -h', t => { |