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
path: root/test/lib
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-03-17 21:13:17 +0300
committerGitHub <noreply@github.com>2022-03-17 21:13:17 +0300
commit84d19210e5604775a3a413aa32cbba2c103933f2 (patch)
tree22dd4f45527ace22f8f504b404735b3168498730 /test/lib
parent2361a68e14f893e97dad53d66fde32082e23521a (diff)
fix: properly show `npm view ./directory` (#4576)
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/commands/view.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lib/commands/view.js b/test/lib/commands/view.js
index e49133dad..82be1201e 100644
--- a/test/lib/commands/view.js
+++ b/test/lib/commands/view.js
@@ -265,6 +265,9 @@ const packument = (nv, opts) => {
if (nv.type === 'git') {
return mocks[nv.hosted.project]
}
+ if (nv.raw === './blue') {
+ return mocks.blue
+ }
return mocks[nv.name]
}
@@ -390,6 +393,11 @@ t.test('should log info of package in current working dir', async t => {
await view.exec(['.'])
t.matchSnapshot(logs)
})
+
+ t.test('directory', async t => {
+ await view.exec(['./blue'])
+ t.matchSnapshot(logs)
+ })
})
t.test('should log info by field name', async t => {