mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-26 19:12:12 -04:00
fix: installation with custom dist-tag
This commit is contained in:
@@ -101,9 +101,8 @@ function argsToSpecs (args: string[], defaultTag: string, where: string): Packag
|
||||
return args
|
||||
.map(arg => npa(arg, where))
|
||||
.map(spec => {
|
||||
if (spec.type === 'tag' && !spec.raw.endsWith('@latest')) {
|
||||
if (spec.type === 'tag' && !spec.rawSpec) {
|
||||
spec.fetchSpec = defaultTag
|
||||
spec.saveSpec = defaultTag
|
||||
}
|
||||
return spec
|
||||
})
|
||||
|
||||
@@ -70,6 +70,16 @@ test('modules without version spec, with custom tag config', async function (t)
|
||||
await project.storeHas('dep-of-pkg-with-1-dep', '100.0.0')
|
||||
})
|
||||
|
||||
test('installing a package by specifying a specific dist-tag', async function (t) {
|
||||
const project = prepare(t)
|
||||
|
||||
await addDistTag('dep-of-pkg-with-1-dep', '100.0.0', 'beta')
|
||||
|
||||
await installPkgs(['dep-of-pkg-with-1-dep@beta'], testDefaults())
|
||||
|
||||
await project.storeHas('dep-of-pkg-with-1-dep', '100.0.0')
|
||||
})
|
||||
|
||||
test('scoped modules with versions (@rstacruz/tap-spec@4.1.1)', async function (t) {
|
||||
const project = prepare(t)
|
||||
await installPkgs(['@rstacruz/tap-spec@4.1.1'], testDefaults())
|
||||
|
||||
Reference in New Issue
Block a user