Skip to content

Commit

Permalink
fix: mock Google language model for tests
Browse files Browse the repository at this point in the history
Co-Authored-By: Han Xiao <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and hanxiao committed Feb 13, 2025
1 parent 17c33e0 commit e6821cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tools/__tests__/evaluator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ jest.mock('@ai-sdk/google', () => ({
GoogleChatLanguageModel: jest.fn()
}));

// Mock the language models
jest.mock('@ai-sdk/google', () => ({
GoogleChatLanguageModel: jest.fn().mockImplementation(() => ({
generateObject: jest.fn().mockResolvedValue({
object: mockEvalResponse,
usage: { totalTokens: 0, promptTokens: 0, completionTokens: 0 }
})
}))
}));

// Mock safe generator to prevent actual API calls
jest.mock('../../utils/safe-generator', () => ({
ObjectGeneratorSafe: jest.fn().mockImplementation(() => ({
Expand Down

0 comments on commit e6821cd

Please sign in to comment.