@@ -1171,7 +1171,7 @@ t.test('audit signatures', async t => {
11711171 t . matchSnapshot ( joinedOutput ( ) )
11721172 } )
11731173
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 => {
11751175 const registryUrl = 'https://verdaccio-clone2.org'
11761176 const { npm } = await loadMockNpm ( t , {
11771177 prefixDir : installWithThirdPartyRegistry ,
@@ -1200,6 +1200,35 @@ t.test('audit signatures', async t => {
12001200 )
12011201 } )
12021202
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+
12031232 t . test ( 'third-party registry with keys and signatures' , async t => {
12041233 const registryUrl = 'https://verdaccio-clone.org'
12051234 const { npm, joinedOutput } = await loadMockNpm ( t , {
0 commit comments