Files
OmniRoute/tests/unit/provider-audit.test.ts
diegosouzapw 47468636e4 feat(dashboard): expand observability and provider tooling
Unify audit access under the logs experience and add richer active
request visibility with sanitized client and provider payload previews.

Expose provider warnings from upstream responses in compliance audit
logs, surface learned rate-limit header data in health monitoring, and
add MCP cache stats and cache flush tools with test coverage.

Also add local provider catalog support for SD WebUI and ComfyUI,
include video generation in endpoint docs and UI, add eval run storage
migrations, and refresh docs and translations to match the expanded
feature set.
2026-04-23 16:57:43 -03:00

24 lines
742 B
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
const providerAudit = await import("../../src/lib/compliance/providerAudit.ts");
test("extractProviderWarnings finds sanitizer and warning fields without duplicating entries", () => {
const warnings = providerAudit.extractProviderWarnings(
{
message: "[SANITIZER] Prompt injection detected: prompt_leak",
warnings: ["[SANITIZER] Prompt injection detected: prompt_leak"],
},
{
detail: {
warning: "Content was filtered by the upstream safety filter.",
},
}
);
assert.deepEqual(warnings, [
"[SANITIZER] Prompt injection detected: prompt_leak",
"Content was filtered by the upstream safety filter.",
]);
});