@@ -157,15 +157,16 @@ describe("GeminiHandler", () => {
157157 expect ( result ) . toBe ( "" )
158158 } )
159159
160- it ( "should pass abort signal through to client via httpOptions " , async ( ) => {
160+ it ( "should pass abort signal through to client via config.abortSignal " , async ( ) => {
161161 const controller = new AbortController ( )
162162 ; ( handler [ "client" ] . models . generateContent as any ) . mockResolvedValue ( { text : "response" } )
163163 await handler . completePrompt ( "test prompt" , { abortSignal : controller . signal } )
164164 expect ( handler [ "client" ] . models . generateContent ) . toHaveBeenCalledWith ( {
165165 model : GEMINI_MODEL_NAME ,
166166 contents : [ { role : "user" , parts : [ { text : "test prompt" } ] } ] ,
167167 config : {
168- httpOptions : { signal : controller . signal } ,
168+ abortSignal : controller . signal ,
169+ httpOptions : undefined ,
169170 temperature : 1 ,
170171 } ,
171172 } )
@@ -185,15 +186,16 @@ describe("GeminiHandler", () => {
185186 } )
186187 } )
187188
188- it ( "should pass timeoutMs through to client via httpOptions" , async ( ) => {
189+ it ( "should pass timeoutMs through to client via httpOptions with abortSignal on config " , async ( ) => {
189190 const controller = new AbortController ( )
190191 ; ( handler [ "client" ] . models . generateContent as any ) . mockResolvedValue ( { text : "response" } )
191192 await handler . completePrompt ( "test prompt" , { abortSignal : controller . signal , timeoutMs : 10000 } )
192193 expect ( handler [ "client" ] . models . generateContent ) . toHaveBeenCalledWith ( {
193194 model : GEMINI_MODEL_NAME ,
194195 contents : [ { role : "user" , parts : [ { text : "test prompt" } ] } ] ,
195196 config : {
196- httpOptions : { signal : controller . signal , timeout : 10000 } ,
197+ abortSignal : controller . signal ,
198+ httpOptions : { timeout : 10000 } ,
197199 temperature : 1 ,
198200 } ,
199201 } )
0 commit comments