Skip to content

Commit c48b22a

Browse files
committed
test(update): align pricing fixtures with main
1 parent 14dfa90 commit c48b22a

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

‎extensions/amazon-bedrock-mantle/discovery.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Amazon Bedrock Mantle tests cover discovery plugin behavior.
2-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2+
import { afterEach, beforeEach, describe, expect, it, onTestFinished, vi } from "vitest";
33

44
const discoveryDebugSpy = vi.hoisted(() => vi.fn());
55
const discoveryLoggerState = vi.hoisted(() => ({ debugEnabled: true }));
@@ -726,8 +726,10 @@ describe("bedrock mantle discovery", () => {
726726
// Implicit provider resolution
727727
// ---------------------------------------------------------------------------
728728

729-
it("resolves implicit provider with introductory pricing when bearer token is set", async () => {
730-
vi.spyOn(Date, "now").mockReturnValue(Date.UTC(2026, 8, 1) - 1);
729+
it("resolves implicit provider when bearer token is set", async () => {
730+
// This catalog includes the promotional contract before the September pricing cutover.
731+
const clock = vi.spyOn(Date, "now").mockReturnValue(Date.UTC(2026, 7, 31));
732+
onTestFinished(() => clock.mockRestore());
731733
const mockFetch = vi.fn().mockResolvedValue(
732734
modelDiscoveryResponse({
733735
data: [{ id: "anthropic.claude-sonnet-4-6", object: "model" }],

‎extensions/anthropic/index.test.ts‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ type Claude5ContractCase = {
7979
checksMedia?: boolean;
8080
restoresMissingCost?: boolean;
8181
checksCliPolicy?: boolean;
82-
pricingAtMs?: number;
8382
};
8483

8584
const ANTHROPIC_SETUP_TOKEN = `sk-ant-oat01-${"a".repeat(80)}`;
@@ -703,11 +702,10 @@ describe("anthropic provider replay hooks", () => {
703702
checksCliPolicy: true,
704703
},
705704
{
706-
name: "resolves Claude Sonnet 5 with its introductory API pricing",
705+
name: "resolves Claude Sonnet 5 with its exact API contract",
707706
modelId: "claude-sonnet-5",
708707
cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
709708
thinkingLevelMap: { xhigh: "xhigh", max: "max" },
710-
pricingAtMs: Date.UTC(2026, 8, 1) - 1,
711709
},
712710
];
713711

@@ -720,12 +718,10 @@ describe("anthropic provider replay hooks", () => {
720718
checksMedia,
721719
restoresMissingCost,
722720
checksCliPolicy,
723-
pricingAtMs,
724721
}) => {
725-
if (pricingAtMs !== undefined) {
726-
const clock = vi.spyOn(Date, "now").mockReturnValue(pricingAtMs);
727-
onTestFinished(() => clock.mockRestore());
728-
}
722+
// This table describes the promotional contract before the September pricing cutover.
723+
const clock = vi.spyOn(Date, "now").mockReturnValue(Date.UTC(2026, 7, 31));
724+
onTestFinished(() => clock.mockRestore());
729725
const provider = await registerSingleProviderPlugin(anthropicPlugin);
730726
const resolved = provider.resolveDynamicModel?.({
731727
provider: "anthropic",

0 commit comments

Comments
 (0)