From f12ec26b8b033ecefe64aabf45b90e7147a4c7c0 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Thu, 13 Nov 2025 23:45:05 +0000 Subject: [PATCH] fix: Update bedrock test mock to match new getModel signature --- src/api/providers/__tests__/bedrock-invokedModelId.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/providers/__tests__/bedrock-invokedModelId.spec.ts b/src/api/providers/__tests__/bedrock-invokedModelId.spec.ts index 7fe7255f5b..0454154ff0 100644 --- a/src/api/providers/__tests__/bedrock-invokedModelId.spec.ts +++ b/src/api/providers/__tests__/bedrock-invokedModelId.spec.ts @@ -317,9 +317,10 @@ describe("AwsBedrockHandler with invokedModelId", () => { } }) - // Mock getModel to throw an error when called with the model name - vitest.spyOn(handler, "getModel").mockImplementation((modelName?: string) => { - if (modelName === "anthropic.claude-3-sonnet-20240229-v1:0") { + // Mock getModel to throw an error when called with context tokens + vitest.spyOn(handler, "getModel").mockImplementation((contextTokens?: number) => { + // Throw error on second call (when it tries to get the invoked model) + if (contextTokens !== undefined) { throw new Error("Test error during model lookup") }