67 lines
3.2 KiB
TypeScript
67 lines
3.2 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import { getDefaultPricing } from "../../src/shared/constants/pricing.ts";
|
|
import { REGISTRY } from "../../open-sse/config/providerRegistry.ts";
|
|
|
|
test("T12: pricing table includes MiniMax, GLM, Kimi and gpt-5.4 mini entries", () => {
|
|
const pricing = getDefaultPricing();
|
|
|
|
assert.ok(pricing.cx["gpt-5.4"], "missing cx/gpt-5.4");
|
|
assert.ok(pricing.cx["gpt-5.4-mini"], "missing cx/gpt-5.4-mini");
|
|
|
|
assert.ok(pricing.minimax["minimax-m2.5"], "missing minimax/minimax-m2.5");
|
|
assert.ok(pricing.minimax["minimax-m2.7"], "missing minimax/minimax-m2.7");
|
|
assert.equal(pricing.minimax["minimax-m2.5"].input, 0.27);
|
|
assert.equal(pricing.minimax["minimax-m2.5"].output, 0.95);
|
|
|
|
assert.ok(pricing.glm["glm-4.7"], "missing glm/glm-4.7");
|
|
assert.ok(pricing.glm["glm-5"], "missing glm/glm-5");
|
|
assert.ok(pricing.glmt["glm-4.7"], "missing glmt/glm-4.7");
|
|
assert.ok(pricing.glmt["glm-5"], "missing glmt/glm-5");
|
|
assert.equal(pricing.glm["glm-4.7"].input, 0.6);
|
|
assert.equal(pricing.glm["glm-4.7"].output, 2.2);
|
|
assert.equal(pricing.glmt["glm-4.7"].input, 0.6);
|
|
assert.equal(pricing.glmt["glm-4.7"].output, 2.2);
|
|
|
|
assert.ok(pricing.kimi["kimi-k2.5"], "missing kimi/kimi-k2.5");
|
|
assert.ok(pricing.kimi["kimi-k2.5-thinking"], "missing kimi/kimi-k2.5-thinking");
|
|
assert.ok(pricing.kimi["kimi-for-coding"], "missing kimi/kimi-for-coding");
|
|
|
|
assert.ok(pricing.anthropic["claude-opus-4.8"], "missing anthropic/claude-opus-4.8");
|
|
assert.ok(pricing.anthropic["claude-opus-4-8"], "missing anthropic/claude-opus-4-8");
|
|
assert.ok(pricing.anthropic["claude-opus-4-7"], "missing anthropic/claude-opus-4-7");
|
|
});
|
|
|
|
test("T12: codex catalog includes GPT 5.5 variations", () => {
|
|
const codexModels = new Map(REGISTRY.codex.models.map((m) => [m.id, m]));
|
|
assert.ok(codexModels.has("gpt-5.5-medium"), "missing codex/gpt-5.5-medium");
|
|
assert.ok(codexModels.has("gpt-5.5-xhigh"), "missing codex/gpt-5.5-xhigh");
|
|
assert.equal(codexModels.get("gpt-5.5-medium")?.name, "GPT 5.5 (Medium)");
|
|
assert.equal(codexModels.get("gpt-5.5-medium")?.targetFormat, "openai-responses");
|
|
assert.equal(codexModels.get("gpt-5.5-xhigh")?.targetFormat, "openai-responses");
|
|
});
|
|
|
|
test("T12: pricing table includes MiniMax-M3 (canonical + lowercase alias)", () => {
|
|
const pricing = getDefaultPricing();
|
|
|
|
assert.ok(pricing.minimax["MiniMax-M3"], "missing minimax/MiniMax-M3");
|
|
assert.ok(pricing.minimax["minimax-m3"], "missing minimax/minimax-m3 alias");
|
|
|
|
for (const key of ["MiniMax-M3", "minimax-m3"]) {
|
|
assert.equal(pricing.minimax[key].input, 0.5, `${key} input`);
|
|
assert.equal(pricing.minimax[key].output, 2.0, `${key} output`);
|
|
assert.equal(pricing.minimax[key].cached, 0.25, `${key} cached`);
|
|
assert.equal(pricing.minimax[key].reasoning, 3.0, `${key} reasoning`);
|
|
assert.equal(pricing.minimax[key].cache_creation, 0.5, `${key} cache_creation`);
|
|
}
|
|
});
|
|
|
|
test("T12: minimax default model list starts with M3", () => {
|
|
const minimaxModels = REGISTRY.minimax.models.map((m) => m.id);
|
|
const minimaxCnModels = REGISTRY["minimax-cn"].models.map((m) => m.id);
|
|
|
|
assert.equal(minimaxModels[0], "MiniMax-M3");
|
|
assert.equal(minimaxCnModels[0], "MiniMax-M3");
|
|
});
|