import { beforeAll, describe, expect, it, vi } from "vitest";
vi.unmock("../secrets/provider-env-vars.js");
let collectProviderApiKeys: typeofimport("./live-auth-keys.js").collectProviderApiKeys;
let isAnthropicBillingError: typeofimport("./live-auth-keys.js").isAnthropicBillingError;
describe("isAnthropicBillingError", () => {
it("does not false-positive on plain 'a 402' prose", () => { const samples = [ "Use a 402 stainless bolt", "Book a 402 room", "There is a 402 near me", "The building at 402 Main Street",
];
for (const sample of samples) {
expect(isAnthropicBillingError(sample)).toBe(false);
}
});
it("matches real 402 billing payload contexts including JSON keys", () => { const samples = [ "HTTP 402 Payment Required", "status: 402", "error code 402", '{"status":402,"type":"error"}', '{"code":402,"message":"payment required"}', '{"error":{"code":402,"message":"billing hard limit reached"}}', "got a 402 from the API", "returned 402", "received a 402 response",
];
for (const sample of samples) {
expect(isAnthropicBillingError(sample)).toBe(true);
}
});
});
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.