@@ -1171,7 +1171,7 @@ t.test('audit signatures', async t => {
1171
1171
t . matchSnapshot ( joinedOutput ( ) )
1172
1172
} )
1173
1173
1174
- t . test ( 'third-party registry without keys does not verify' , async t => {
1174
+ t . test ( 'third-party registry without keys (E404) does not verify' , async t => {
1175
1175
const registryUrl = 'https://verdaccio-clone2.org'
1176
1176
const { npm } = await loadMockNpm ( t , {
1177
1177
prefixDir : installWithThirdPartyRegistry ,
@@ -1200,6 +1200,35 @@ t.test('audit signatures', async t => {
1200
1200
)
1201
1201
} )
1202
1202
1203
+ t . test ( 'third-party registry without keys (E400) does not verify' , async t => {
1204
+ const registryUrl = 'https://verdaccio-clone2.org'
1205
+ const { npm } = await loadMockNpm ( t , {
1206
+ prefixDir : installWithThirdPartyRegistry ,
1207
+ config : {
1208
+ '@npmcli:registry' : registryUrl ,
1209
+ } ,
1210
+ } )
1211
+ const registry = new MockRegistry ( { tap : t , registry : registryUrl } )
1212
+ const manifest = registry . manifest ( {
1213
+ name : '@npmcli/arborist' ,
1214
+ packuments : [ {
1215
+ version : '1.0.14' ,
1216
+ dist : {
1217
+ tarball : 'https://registry.npmjs.org/@npmcli/arborist/-/@npmcli/arborist-1.0.14.tgz' ,
1218
+ integrity : 'sha512-caa8hv5rW9VpQKk6tyNRvSaVDySVjo9GkI7Wj/wcsFyxPm3tYrE' +
1219
+ 'sFyTjSnJH8HCIfEGVQNjqqKXaXLFVp7UBag==' ,
1220
+ } ,
1221
+ } ] ,
1222
+ } )
1223
+ await registry . package ( { manifest } )
1224
+ registry . nock . get ( '/-/npm/v1/keys' ) . reply ( 400 )
1225
+
1226
+ await t . rejects (
1227
+ npm . exec ( 'audit' , [ 'signatures' ] ) ,
1228
+ / f o u n d n o d e p e n d e n c i e s t o a u d i t t h a t w h e r e i n s t a l l e d f r o m a s u p p o r t e d r e g i s t r y /
1229
+ )
1230
+ } )
1231
+
1203
1232
t . test ( 'third-party registry with keys and signatures' , async t => {
1204
1233
const registryUrl = 'https://verdaccio-clone.org'
1205
1234
const { npm, joinedOutput } = await loadMockNpm ( t , {
0 commit comments