Files
OmniRoute/tests/unit/free-note-freshness.test.ts
Bob.Hou 109cf0f26c fix(providers): reclassify Cerebras as a one-time $5 signup credit (#12591)
Validado sobre o tip de release/v3.8.51 — e o PR ficou completo depois que o autor adicionou a tabela de preços.

O que fazia o teste falhar antes não era a lista free (que o PR já tinha corrigido em `LEGACY_FREE_PROVIDERS` e `tierDefaults.json`), e sim que `classifyTier` cai no ramo cost-based e todos os modelos Cerebras estavam declarados com `input: 0, output: 0` — $0/M ≤ threshold devolve 'free' de qualquer jeito. A tabela de preços resolve isso na raiz.

Confirmei o `gpt-oss-120b` a $0,35/$0,75 de forma independente contra a fonte pública, o que corrobora o resto da tabela. **4/4** no teste-guarda e **25/25** somando free-tier-catalog e free-models; typecheck:core limpo. Obrigado, @HouMinXi.
2026-09-03 21:30:32 -03:00

23 lines
821 B
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import { getProviderById } from "../../src/shared/constants/providers.ts";
const note = (id: string): string => getProviderById(id)?.freeNote ?? "";
test("kiro freeNote reflects the current 50-credit/month reality + ToS warning", () => {
const n = note("kiro");
assert.match(n, /50 credits\/month/i);
assert.match(n, /ToS|proxy/i);
});
test("longcat freeNote reflects the post-2026-05-29 5M tokens/day reality", () => {
assert.match(note("longcat"), /5M tokens\/day|LongCat-2\.0/i);
});
test("cerebras freeNote reflects the $5 card-gated signup credit (#11773)", () => {
const n = note("cerebras");
assert.match(n, /\$5/);
assert.match(n, /payment method|credit card/i);
assert.equal(/1M tokens\/day|30K TPM/.test(n), false);
});