@@ -59,10 +59,7 @@ describe("BaseOpenAiCompatibleProvider completePrompt", () => {
5959 const controller = new AbortController ( )
6060 await handler . completePrompt ( "test prompt" , { abortSignal : controller . signal } )
6161
62- expect ( mockCreate ) . toHaveBeenCalledWith (
63- expect . objectContaining ( { model : "test-model" } ) ,
64- expect . objectContaining ( { signal : controller . signal } ) ,
65- )
62+ expect ( mockCreate . mock . calls [ 0 ] [ 1 ] . signal ) . toBe ( controller . signal )
6663 } )
6764
6865 it ( "should pass timeoutMs through to client as timeout" , async ( ) => {
@@ -76,10 +73,7 @@ describe("BaseOpenAiCompatibleProvider completePrompt", () => {
7673
7774 await handler . completePrompt ( "test prompt" , { timeoutMs : 5000 } )
7875
79- expect ( mockCreate ) . toHaveBeenCalledWith (
80- expect . objectContaining ( { model : "test-model" } ) ,
81- expect . objectContaining ( { timeout : 5000 } ) ,
82- )
76+ expect ( mockCreate . mock . calls [ 0 ] [ 1 ] . timeout ) . toBe ( 5000 )
8377 } )
8478
8579 it ( "should pass both signal and timeout when both are provided" , async ( ) => {
@@ -94,10 +88,8 @@ describe("BaseOpenAiCompatibleProvider completePrompt", () => {
9488 const controller = new AbortController ( )
9589 await handler . completePrompt ( "test prompt" , { abortSignal : controller . signal , timeoutMs : 5000 } )
9690
97- expect ( mockCreate ) . toHaveBeenCalledWith (
98- expect . objectContaining ( { model : "test-model" } ) ,
99- expect . objectContaining ( { signal : controller . signal , timeout : 5000 } ) ,
100- )
91+ expect ( mockCreate . mock . calls [ 0 ] [ 1 ] . signal ) . toBe ( controller . signal )
92+ expect ( mockCreate . mock . calls [ 0 ] [ 1 ] . timeout ) . toBe ( 5000 )
10193 } )
10294
10395 it ( "should work without options (backward compatible)" , async ( ) => {
0 commit comments