File tree 1 file changed +18
-16
lines changed
1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -414,15 +414,16 @@ describe('generateContentStream', () => {
414
414
item
415
415
) } `
416
416
) ;
417
- expect (
418
- item . candidates ! [ 0 ] . content . parts [ 0 ] . text ?. toLowerCase ( )
419
- ) . toContain (
420
- WEATHER_FORECAST ,
421
- `sys test failure on generateContentStream for candidate part ${ JSON . stringify (
422
- item . candidates ! [ 0 ] . content . parts [ 0 ]
423
- ) } `
424
- ) ;
425
417
}
418
+ const aggregaratedResponse = await streamingResp . response ;
419
+ expect (
420
+ aggregaratedResponse . candidates ! [ 0 ] . content . parts [ 0 ] . text ?. toLowerCase ( )
421
+ ) . toContain (
422
+ WEATHER_FORECAST ,
423
+ `sys test failure on generateContentStream for candidate part ${ JSON . stringify (
424
+ aggregaratedResponse . candidates ! [ 0 ] . content . parts [ 0 ]
425
+ ) } `
426
+ ) ;
426
427
} ) ;
427
428
it ( 'in preview should return a text when passed a FunctionDeclaration or FunctionResponse' , async ( ) => {
428
429
const request = {
@@ -441,15 +442,16 @@ describe('generateContentStream', () => {
441
442
item
442
443
) } `
443
444
) ;
444
- expect (
445
- item . candidates ! [ 0 ] . content . parts [ 0 ] . text ?. toLowerCase ( )
446
- ) . toContain (
447
- WEATHER_FORECAST ,
448
- `sys test failure on generateContentStream in preview for candidate part ${ JSON . stringify (
449
- item . candidates ! [ 0 ] . content . parts [ 0 ]
450
- ) } `
451
- ) ;
452
445
}
446
+ const aggregaratedResponse = await streamingResp . response ;
447
+ expect (
448
+ aggregaratedResponse . candidates ! [ 0 ] . content . parts [ 0 ] . text ?. toLowerCase ( )
449
+ ) . toContain (
450
+ WEATHER_FORECAST ,
451
+ `sys test failure on generateContentStream for candidate part ${ JSON . stringify (
452
+ aggregaratedResponse . candidates ! [ 0 ] . content . parts [ 0 ]
453
+ ) } `
454
+ ) ;
453
455
} ) ;
454
456
it ( 'should return a FunctionCall when passed a FunctionDeclaration' , async ( ) => {
455
457
const request = {
You can’t perform that action at this time.
0 commit comments