Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/utils/did-you-mean.js')
-rw-r--r--test/lib/utils/did-you-mean.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/lib/utils/did-you-mean.js b/test/lib/utils/did-you-mean.js
index 48b6d4027..898806aa1 100644
--- a/test/lib/utils/did-you-mean.js
+++ b/test/lib/utils/did-you-mean.js
@@ -7,25 +7,37 @@ t.test('did-you-mean', t => {
npm.load(err => {
t.notOk(err)
t.test('nistall', async t => {
- const result = await dym(npm, 'nistall')
+ const result = await dym(npm, npm.localPrefix, 'nistall')
t.match(result, 'Unknown command')
t.match(result, 'npm install')
})
t.test('sttest', async t => {
- const result = await dym(npm, 'sttest')
+ const result = await dym(npm, npm.localPrefix, 'sttest')
t.match(result, 'Unknown command')
t.match(result, 'npm test')
t.match(result, 'npm run posttest')
})
t.test('npz', async t => {
- const result = await dym(npm, 'npxx')
+ const result = await dym(npm, npm.localPrefix, 'npxx')
t.match(result, 'Unknown command')
t.match(result, 'npm exec npx')
})
t.test('qwuijbo', async t => {
- const result = await dym(npm, 'qwuijbo')
+ const result = await dym(npm, npm.localPrefix, 'qwuijbo')
t.match(result, 'Unknown command')
})
t.end()
})
})
+
+t.test('missing bin and script properties', async t => {
+ const path = t.testdir({
+ 'package.json': JSON.stringify({
+ name: 'missing-bin',
+ }),
+ })
+
+ const result = await dym(npm, path, 'nistall')
+ t.match(result, 'Unknown command')
+ t.match(result, 'npm install')
+})