diff options
Diffstat (limited to 'deps/npm/test/lib/dist-tag.js')
-rw-r--r-- | deps/npm/test/lib/dist-tag.js | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/deps/npm/test/lib/dist-tag.js b/deps/npm/test/lib/dist-tag.js index 8b1106fa39e..c189352302e 100644 --- a/deps/npm/test/lib/dist-tag.js +++ b/deps/npm/test/lib/dist-tag.js @@ -294,35 +294,13 @@ test('remove missing pkg name', (t) => { test('completion', t => { const { completion } = distTag - t.plan(3) + t.plan(2) - completion({ - conf: { - argv: { - remain: ['npm', 'dist-tag'], - }, - }, - }, (err, res) => { - t.ifError(err, 'npm dist-tags completion') - - t.strictSame( - res, - [ - 'add', - 'rm', - 'ls', - ], - 'should list npm dist-tag commands for completion' - ) - }) + const match = completion({ conf: { argv: { remain: ['npm', 'dist-tag'] } } }) + t.resolveMatch(match, ['add', 'rm', 'ls'], + 'should list npm dist-tag commands for completion') - completion({ - conf: { - argv: { - remain: ['npm', 'dist-tag', 'foobar'], - }, - }, - }, (err) => { - t.notOk(err, 'should ignore any unknown name') - }) + const noMatch = completion({ conf: { argv: { remain: ['npm', 'dist-tag', 'foobar'] } } }) + t.resolveMatch(noMatch, []) + t.end() }) |