diff options
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/npm.js | 12 | ||||
-rw-r--r-- | test/lib/utils/deref-command.js | 9 |
2 files changed, 7 insertions, 14 deletions
diff --git a/test/lib/npm.js b/test/lib/npm.js index 541c1258d..998e96314 100644 --- a/test/lib/npm.js +++ b/test/lib/npm.js @@ -548,12 +548,14 @@ t.test('output clears progress and console.logs the message', async t => { t.end() }) -t.test('unknown command', async t => { +t.test('aliases and typos', async t => { const { npm } = await loadMockNpm(t, { load: false }) - await t.rejects( - npm.cmd('thisisnotacommand'), - { code: 'EUNKNOWNCOMMAND' } - ) + await t.rejects(npm.cmd('thisisnotacommand'), { code: 'EUNKNOWNCOMMAND' }) + await t.rejects(npm.cmd(''), { code: 'EUNKNOWNCOMMAND' }) + await t.rejects(npm.cmd('birt'), { code: 'EUNKNOWNCOMMAND' }) + await t.resolves(npm.cmd('it'), { name: 'install-test' }) + await t.resolves(npm.cmd('installTe'), { name: 'install-test' }) + await t.resolves(npm.cmd('birthday'), { name: 'birthday' }) }) t.test('explicit workspace rejection', async t => { diff --git a/test/lib/utils/deref-command.js b/test/lib/utils/deref-command.js deleted file mode 100644 index 474488c58..000000000 --- a/test/lib/utils/deref-command.js +++ /dev/null @@ -1,9 +0,0 @@ -const t = require('tap') -const deref = require('../../../lib/utils/deref-command.js') - -t.equal(deref(null), '') -t.equal(deref(8), '') -t.equal(deref('it'), 'install-test') -t.equal(deref('installTe'), 'install-test') -t.equal(deref('birthday'), 'birthday') -t.equal(deref('birt'), '') |