test(model-pricing): add cache pricing coverage for Opus 4.7

Mirrors the existing `claude-opus-4-6` cache pricing test for both
`claude-opus-4-7` and `claude-opus-4-7-thinking` to explicitly
validate cache creation/read rates in end-to-end cost calculation.

Addresses PResto atrvd/ccs#8 issue #6 (suggestion).

Built [OnSteroids](https://onsteroids.ai)
This commit is contained in:
Sergey Galuza
2026-04-20 19:24:43 +02:00
parent 7492688eff
commit de0f8b3264
+22
View File
@@ -236,6 +236,28 @@ describe('model-pricing', () => {
const cost = calculateCost(usage, 'claude-opus-4-6');
expect(cost).toBe(36.75); // 5 + 25 + 6.25 + 0.5
});
it('should calculate Claude Opus 4.7 cost including cache token rates', () => {
const usage: TokenUsage = {
inputTokens: 1_000_000,
outputTokens: 1_000_000,
cacheCreationTokens: 1_000_000,
cacheReadTokens: 1_000_000,
};
const cost = calculateCost(usage, 'claude-opus-4-7');
expect(cost).toBe(36.75); // 5 + 25 + 6.25 + 0.5
});
it('should calculate Claude Opus 4.7 Thinking cost including cache token rates', () => {
const usage: TokenUsage = {
inputTokens: 1_000_000,
outputTokens: 1_000_000,
cacheCreationTokens: 1_000_000,
cacheReadTokens: 1_000_000,
};
const cost = calculateCost(usage, 'claude-opus-4-7-thinking');
expect(cost).toBe(36.75); // 5 + 25 + 6.25 + 0.5
});
});
describe('getKnownModels', () => {