File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1186,3 +1186,37 @@ t.test('ALLOWS publish when not published yet', async t => {
1186
1186
} ) . reply ( 200 , { } )
1187
1187
await npm . exec ( 'publish' , [ ] )
1188
1188
} )
1189
+
1190
+ t . test ( 'ALLOWS publish when not published yet (no versions)' , async t => {
1191
+ const version = '100.0.0'
1192
+
1193
+ const { npm } = await loadMockNpm ( t , {
1194
+ config : {
1195
+ loglevel : 'silent' ,
1196
+ [ `${ alternateRegistry . slice ( 6 ) } /:_authToken` ] : 'test-other-token' ,
1197
+ } ,
1198
+ prefixDir : {
1199
+ 'package.json' : JSON . stringify ( {
1200
+ ...pkgJson ,
1201
+ version,
1202
+ publishConfig : { registry : alternateRegistry } ,
1203
+ } , null , 2 ) ,
1204
+ } ,
1205
+ mocks : {
1206
+ ...mockNpmRegistryFetch ( {
1207
+ [ `/${ pkg } ` ] : { versions : { } } ,
1208
+ } ) . mocks ,
1209
+ } ,
1210
+ } )
1211
+ const registry = new MockRegistry ( {
1212
+ tap : t ,
1213
+ registry : alternateRegistry ,
1214
+ authorization : 'test-other-token' ,
1215
+ } )
1216
+ registry . nock . put ( `/${ pkg } ` , body => {
1217
+ return t . match ( body , putPackagePayload ( {
1218
+ pkg, alternateRegistry, version,
1219
+ } ) )
1220
+ } ) . reply ( 200 , { } )
1221
+ await npm . exec ( 'publish' , [ ] )
1222
+ } )
You can’t perform that action at this time.
0 commit comments