Skip to content

Commit 14e8899

Browse files
committed
chore: squash adds test for older existing version
1 parent 9c99f23 commit 14e8899

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/lib/commands/publish.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,15 @@ t.test('latest dist tag', (t) => {
898898
}, new Error('You cannot publish over the previously published versions: 100.0.0.'))
899899
})
900900

901+
t.test('PREVENTS publish when publishing version EXISTS ALREADY in the registry', async t => {
902+
const version = '50.0.0'
903+
const { npm, registry } = await loadNpmWithRegistry(t, init(version))
904+
registry.publish(pkg, { noPut: true, packuments })
905+
await t.rejects(async () => {
906+
await npm.exec('publish', [])
907+
}, new Error('You cannot publish over the previously published versions: 50.0.0.'))
908+
})
909+
901910
t.test('ALLOWS publish when latest is HIGHER than publishing version and flag', async t => {
902911
const version = '99.0.0'
903912
const { npm, registry } = await loadNpmWithRegistry(t, {

0 commit comments

Comments
 (0)