From 3f19aebec515d71c81d568458b13525988057594 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 16 Jun 2022 09:22:14 -0700 Subject: [PATCH] fixup! added test coverage for the bug fix --- lib/commands/view.js | 2 +- test/lib/commands/view.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/commands/view.js b/lib/commands/view.js index 0acccc0522d36..f27cf75135168 100644 --- a/lib/commands/view.js +++ b/lib/commands/view.js @@ -241,7 +241,7 @@ class View extends BaseCommand { const er = new Error(`No match found for version ${version}`) er.statusCode = 404 er.code = 'E404' - er.pkgid = pckmnt._id + er.pkgid = `${pckmnt._id}@${version}` throw er } diff --git a/test/lib/commands/view.js b/test/lib/commands/view.js index c2010f9c78008..d347bc9230ec8 100644 --- a/test/lib/commands/view.js +++ b/test/lib/commands/view.js @@ -33,6 +33,7 @@ const packument = (nv, opts) => { }, }, blue: { + _id: 'blue', name: 'blue', 'dist-tags': { latest: '1.0.0', @@ -472,7 +473,6 @@ t.test('throws when version not matched', async t => { ) }) - t.test('workspaces', async t => { const prefixDir = { 'package.json': JSON.stringify({