@@ -4819,6 +4819,7 @@ describe('rerun --wait — dashboardUrl on terminal output', () => {
48194819 ) ;
48204820 } ) ;
48214821} ) ;
4822+
48224823// ---------------------------------------------------------------------------
48234824// Batch --all --wait fan-out: RequestTimeoutError must not leave stdout empty
48244825// ---------------------------------------------------------------------------
@@ -4854,7 +4855,7 @@ describe('[finding-5] batch rerun --wait: RequestTimeoutError during fan-out pol
48544855 output : 'json' ,
48554856 debug : false
48564857 } ,
4857- { ...creds , sleep : instantSleep , fetchImpl : fetchImpl as any , stdout : ( l ) => stdoutLines . push ( l ) , stderr : ( ) => undefined }
4858+ { ...creds , sleep : instantSleep , fetchImpl : fetchImpl as unknown as FetchImpl , stdout : ( l ) => stdoutLines . push ( l ) , stderr : ( ) => undefined }
48584859 ) . catch ( ( e ) => e ) ;
48594860 expect ( err ) . toMatchObject ( { exitCode : 7 } ) ;
48604861 } ) ;
@@ -4867,8 +4868,8 @@ describe('[finding-4] single FE rerun --wait: TimeoutError writes partial JSON t
48674868 it ( 'exit 7 AND stdout contains {runId, status:"running"} when --timeout polling deadline is exceeded' , async ( ) => {
48684869 const creds = makeCreds ( ) ;
48694870 const rerunResp = { runId : 'run_fe_01' , status : 'accepted' } ;
4870- const fetchImpl : any = async ( input : any ) => {
4871- const url = typeof input === 'string' ? input : input . url ;
4871+ const fetchImpl : FetchImpl = async ( input ) => {
4872+ const url = typeof input === 'string' ? input : ( input as Request ) . url ;
48724873 if ( url . includes ( '/runs/rerun' ) ) return new Response ( JSON . stringify ( rerunResp ) , { status : 202 } ) ;
48734874 if ( url . includes ( '/runs/' ) ) return new Response ( JSON . stringify ( { runId : rerunResp . runId , status : 'running' , finishedAt : null } ) , { status : 200 } ) ;
48744875 return new Response ( JSON . stringify ( { error : { code : 'NOT_FOUND' } } ) , { status : 404 } ) ;
@@ -4888,10 +4889,10 @@ describe('[finding-4] single FE rerun --wait: TimeoutError writes partial JSON t
48884889 profile : 'default' ,
48894890 debug : false
48904891 } ,
4891- { ...creds , sleep : instantSleep , fetchImpl : fetchImpl as any , stdout : ( l ) => stdoutLines . push ( l ) , stderr : ( ) => undefined }
4892+ { ...creds , sleep : instantSleep , fetchImpl : fetchImpl as unknown as FetchImpl , stdout : ( l ) => stdoutLines . push ( l ) , stderr : ( ) => undefined }
48924893 ) . catch ( ( e ) => e ) ;
48934894 expect ( err ) . toMatchObject ( { exitCode : 7 } ) ;
4894- const parsed = JSON . parse ( stdoutLines . join ( '\n' ) ) ;
4895+ const parsed = JSON . parse ( stdoutLines . join ( '\n' ) ) as { runId : string ; status : string } ;
48954896 expect ( parsed . runId ) . toBe ( rerunResp . runId ) ;
48964897 expect ( parsed . status ) . toBe ( 'running' ) ;
48974898 } ) ;
0 commit comments