Skip to content

Commit 1dd520d

Browse files
committed
fixup! fix(publish): skip private workspaces
1 parent 9267ec7 commit 1dd520d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/lib/publish.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,5 +732,33 @@ t.test('private workspaces', (t) => {
732732
})
733733
})
734734

735+
t.test('unexpected error', t => {
736+
const Publish = t.mock('../../lib/publish.js', {
737+
...mocks,
738+
libnpmpublish: {
739+
publish: (manifest, tarballData, opts) => {
740+
if (manifest.private)
741+
throw new Error('ERR')
742+
743+
publishes.push(manifest)
744+
},
745+
},
746+
npmlog: {
747+
notice () {},
748+
verbose () {},
749+
},
750+
})
751+
const publish = new Publish(npm)
752+
753+
publish.execWorkspaces([], [], (err) => {
754+
t.match(
755+
err,
756+
/ERR/,
757+
'should throw unexpected error'
758+
)
759+
t.end()
760+
})
761+
})
762+
735763
t.end()
736764
})

0 commit comments

Comments
 (0)