cte 10 luni în urmă
părinte
comite
a130e656f1

+ 7 - 5
src/api/providers/__tests__/glama.test.ts

@@ -1,9 +1,11 @@
-import { GlamaHandler } from "../glama"
-import { ApiHandlerOptions } from "../../../shared/api"
-import OpenAI from "openai"
+// npx jest src/api/providers/__tests__/glama.test.ts
+
 import { Anthropic } from "@anthropic-ai/sdk"
 import axios from "axios"
 
+import { GlamaHandler } from "../glama"
+import { ApiHandlerOptions } from "../../../shared/api"
+
 // Mock OpenAI client
 const mockCreate = jest.fn()
 const mockWithResponse = jest.fn()
@@ -71,8 +73,8 @@ describe("GlamaHandler", () => {
 
 	beforeEach(() => {
 		mockOptions = {
-			apiModelId: "anthropic/claude-3-5-sonnet",
-			glamaModelId: "anthropic/claude-3-5-sonnet",
+			apiModelId: "anthropic/claude-3-7-sonnet",
+			glamaModelId: "anthropic/claude-3-7-sonnet",
 			glamaApiKey: "test-api-key",
 		}
 		handler = new GlamaHandler(mockOptions)

+ 3 - 1
src/api/providers/__tests__/openrouter.test.ts

@@ -1,3 +1,5 @@
+// npx jest src/api/providers/__tests__/openrouter.test.ts
+
 import { OpenRouterHandler } from "../openrouter"
 import { ApiHandlerOptions, ModelInfo } from "../../../shared/api"
 import OpenAI from "openai"
@@ -55,7 +57,7 @@ describe("OpenRouterHandler", () => {
 		const handler = new OpenRouterHandler({})
 		const result = handler.getModel()
 
-		expect(result.id).toBe("anthropic/claude-3.5-sonnet:beta")
+		expect(result.id).toBe("anthropic/claude-3.7-sonnet")
 		expect(result.info.supportsPromptCache).toBe(true)
 	})
 

+ 5 - 2
src/api/providers/__tests__/vertex.test.ts

@@ -1,7 +1,10 @@
-import { VertexHandler } from "../vertex"
+// npx jest src/api/providers/__tests__/vertex.test.ts
+
 import { Anthropic } from "@anthropic-ai/sdk"
 import { AnthropicVertex } from "@anthropic-ai/vertex-sdk"
 
+import { VertexHandler } from "../vertex"
+
 // Mock Vertex SDK
 jest.mock("@anthropic-ai/vertex-sdk", () => ({
 	AnthropicVertex: jest.fn().mockImplementation(() => ({
@@ -289,7 +292,7 @@ describe("VertexHandler", () => {
 				vertexRegion: "us-central1",
 			})
 			const modelInfo = invalidHandler.getModel()
-			expect(modelInfo.id).toBe("claude-3-5-sonnet-v2@20241022") // Default model
+			expect(modelInfo.id).toBe("claude-3-7-sonnet@20250219") // Default model
 		})
 	})
 })