@@ -33,8 +33,6 @@ test('@google/genai unit.tests', async (t) => {
3333
3434 function getMockModule ( ) {
3535 function GoogleGenAi ( ) { }
36- GoogleGenAi . HttpResponse = function ( ) { }
37- GoogleGenAi . HttpResponse . prototype . json = async function ( ) { }
3836 GoogleGenAi . Models = function ( ) { }
3937 GoogleGenAi . Models . prototype . generateContentInternal = async function ( ) { }
4038 GoogleGenAi . Models . prototype . generateContentStreamInternal = async function ( ) { }
@@ -48,7 +46,11 @@ test('@google/genai unit.tests', async (t) => {
4846 initialize ( agent , MockGoogleGenAi , '@google/genai' , shim )
4947 assert . equal ( shim . logger . debug . callCount , 0 , 'should not log debug messages' )
5048 const isWrapped = shim . isWrapped ( MockGoogleGenAi . Models . prototype . generateContentInternal )
49+ const isStreamWrapped = shim . isWrapped ( MockGoogleGenAi . Models . prototype . generateContentStreamInternal )
50+ const isEmbedWrapped = shim . isWrapped ( MockGoogleGenAi . Models . prototype . embedContent )
5151 assert . equal ( isWrapped , true , 'should wrap models generateContentInternal' )
52+ assert . equal ( isStreamWrapped , true , 'should wrap models generateContentStreamInternal' )
53+ assert . equal ( isEmbedWrapped , true , 'should wrap models embedContent' )
5254 end ( )
5355 } )
5456
@@ -83,7 +85,11 @@ test('@google/genai unit.tests', async (t) => {
8385 assert . equal ( shim . logger . debug . callCount , 1 , 'should log 1 debug message' )
8486 assert . equal ( shim . logger . debug . args [ 0 ] [ 0 ] , 'config.ai_monitoring.enabled is set to false.' )
8587 const isWrapped = shim . isWrapped ( MockGoogleGenAi . Models . prototype . generateContentInternal )
86- assert . equal ( isWrapped , false , 'should not wrap models generate content internal' )
88+ const isStreamWrapped = shim . isWrapped ( MockGoogleGenAi . Models . prototype . generateContentStreamInternal )
89+ const isEmbedWrapped = shim . isWrapped ( MockGoogleGenAi . Models . prototype . embedContent )
90+ assert . equal ( isWrapped , false , 'should not wrap models generateContentInternal' )
91+ assert . equal ( isStreamWrapped , false , 'should not wrap models generateContentStreamInternal' )
92+ assert . equal ( isEmbedWrapped , false , 'should not wrap models embedContent' )
8793 end ( )
8894 }
8995 )
0 commit comments