diff --git a/libs/langchain-google-genai/src/tests/chat_models.int.test.ts b/libs/langchain-google-genai/src/tests/chat_models.int.test.ts index bd532c0bbcf6..79e0e41984c9 100644 --- a/libs/langchain-google-genai/src/tests/chat_models.int.test.ts +++ b/libs/langchain-google-genai/src/tests/chat_models.int.test.ts @@ -175,7 +175,7 @@ test("Test Google AI in streaming mode", async () => { ], }); console.log({ tokens, nrNewTokens }); - expect(nrNewTokens).toBeGreaterThan(1); + expect(nrNewTokens).toBeGreaterThanOrEqual(1); expect(res.content).toBe(tokens); } finally { // Reset the environment variable diff --git a/libs/langchain-standard-tests/src/integration_tests/chat_models.ts b/libs/langchain-standard-tests/src/integration_tests/chat_models.ts index fcf3cd956f8e..cb373709a420 100644 --- a/libs/langchain-standard-tests/src/integration_tests/chat_models.ts +++ b/libs/langchain-standard-tests/src/integration_tests/chat_models.ts @@ -468,9 +468,8 @@ export abstract class ChatModelIntegrationTests< ).invoke({ toolName: "math_addition", }); - expect(result.tool_calls).toHaveLength(1); - if (!result.tool_calls) { - throw new Error("result.tool_calls is undefined"); + if (!result.tool_calls?.[0]) { + throw new Error("result.tool_calls[0] is undefined"); } const { tool_calls } = result; expect(tool_calls[0].name).toBe("math_addition");