@@ -906,6 +906,26 @@ t.test('audit signatures', async t => {
906906 t . matchSnapshot ( joinedOutput ( ) )
907907 } )
908908
909+ t . test ( 'with min-release-age set verifies installed versions' , async t => {
910+ const { npm, joinedOutput } = await loadMockNpm ( t , {
911+ prefixDir : installWithValidSigs ,
912+ config : {
913+ 'min-release-age' : 99999 ,
914+ } ,
915+ } )
916+ const registry = new MockRegistry ( { tap : t , registry : npm . config . get ( 'registry' ) } )
917+ await manifestWithValidSigs ( { registry } )
918+ mockTUF ( { npm, target : TUF_VALID_KEYS_TARGET } )
919+
920+ // min-release-age flattens into a `before` cutoff that previously leaked
921+ // into the exact-version manifest lookup, producing a spurious ETARGET on
922+ // already-installed versions. See npm/cli#9277.
923+ await npm . exec ( 'audit' , [ 'signatures' ] )
924+
925+ t . notOk ( process . exitCode , 'should exit successfully' )
926+ t . match ( joinedOutput ( ) , / a u d i t e d 1 p a c k a g e / )
927+ } )
928+
909929 t . test ( 'with valid signatures using alias' , async t => {
910930 const { npm, joinedOutput } = await loadMockNpm ( t , {
911931 prefixDir : installWithAlias ,
0 commit comments