Files
OmniRoute/tests/unit/service-token-limit-counter.test.ts
Paijo 89c52d4f04 fix: resolve pre-existing test failures (env sync, PII, quota, sidebar) (#3039)
Integrated into release/v3.8.8. 9 legit test alignments + 34 new test files kept; restored 5 masked assertions (sk_ key redaction, circular/SSN redaction, T24 wait-log, THEORY-004 SSE, relay handoff) to strict/meaningful checks. Thanks @oyi77!
2026-06-01 14:52:50 -03:00

27 lines
763 B
TypeScript

import { describe, it } from "node:test";
import assert from "node:assert/strict";
const mod = await import("../../open-sse/services/tokenLimitCounter.ts");
describe("tokenLimitCounter", () => {
describe("cache management", () => {
it("clearTokenLimitCache does not throw", () => {
mod.clearTokenLimitCache();
});
it("syncCache does not throw", () => {
mod.syncCache("test-limit-" + Date.now(), new Date().toISOString(), 100);
});
it("invalidateLimit does not throw", () => {
mod.invalidateLimit("test-limit-" + Date.now());
});
});
describe("recordTokenUsage", () => {
it("does not throw for empty limits", () => {
mod.recordTokenUsage([], { input: 10, output: 5, reasoning: 0 });
});
});
});