Skip to content

Commit

Permalink
fixup! fix(publish): skip private workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ruyadorno committed May 27, 2021
1 parent 9267ec7 commit 1dd520d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/lib/publish.js
Expand Up @@ -732,5 +732,33 @@ t.test('private workspaces', (t) => {
})
})

t.test('unexpected error', t => {
const Publish = t.mock('../../lib/publish.js', {
...mocks,
libnpmpublish: {
publish: (manifest, tarballData, opts) => {
if (manifest.private)
throw new Error('ERR')

publishes.push(manifest)
},
},
npmlog: {
notice () {},
verbose () {},
},
})
const publish = new Publish(npm)

publish.execWorkspaces([], [], (err) => {
t.match(
err,
/ERR/,
'should throw unexpected error'
)
t.end()
})
})

t.end()
})

0 comments on commit 1dd520d

Please sign in to comment.