Skip to content

Commit

Permalink
fix: mock safe generator at a higher level
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 e485a08 commit ed75cf4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tools/__tests__/evaluator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jest.mock('@ai-sdk/google', () => ({
GoogleChatLanguageModel: jest.fn()
}));

// Mock the language models
jest.mock('@ai-sdk/google', () => ({
GoogleChatLanguageModel: jest.fn().mockImplementation(() => ({
// Mock the safe generator to prevent actual API calls
jest.mock('../../utils/safe-generator', () => ({
ObjectGeneratorSafe: jest.fn().mockImplementation(() => ({
generateObject: jest.fn().mockImplementation(async () => ({
object: mockEvalResponse,
usage: { totalTokens: 0, promptTokens: 0, completionTokens: 0 }
Expand Down

0 comments on commit ed75cf4

Please sign in to comment.