mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
Release v3.8.41 — 52 commits since v3.8.40 (19 CHANGELOG bullets, 11 contributors). All gating CI green: Unit×8, Coverage×8, Vitest, Package Artifact, Quality Ratchet, CodeQL, Lint, Docs Sync (Strict), Node 24/26 compat, E2E×9, Integration, Electron smoke. Advisory checks overridden (main unprotected): PR Test Policy = test-masking heuristic on the cumulative 52-commit assert delta (legitimate dead-code-sweep removals + consolidations, reviewed per-PR); SonarCloud/SonarQube = new-code maintainability/coverage quality gate (CodeQL/Semgrep/Security/npm-audit/Dependabot all clean — not a security finding).
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import {
|
|
createProviderSchema,
|
|
createKeySchema,
|
|
loginSchema,
|
|
} from "../../src/shared/validation/schemas.ts";
|
|
|
|
test("modular schemas: createProviderSchema validates correctly", () => {
|
|
const valid = createProviderSchema.safeParse({
|
|
name: "openai",
|
|
provider: "openai",
|
|
apiKey: "sk-1234",
|
|
});
|
|
assert.equal(valid.success, true);
|
|
});
|
|
|
|
test("modular schemas: createKeySchema validates correctly", () => {
|
|
const valid = createKeySchema.safeParse({
|
|
name: "test-key",
|
|
});
|
|
assert.equal(valid.success, true);
|
|
});
|
|
|
|
test("modular schemas: loginSchema validates correctly", () => {
|
|
const valid = loginSchema.safeParse({
|
|
password: "securepassword",
|
|
});
|
|
assert.equal(valid.success, true);
|
|
|
|
const invalid = loginSchema.safeParse({
|
|
password: "",
|
|
});
|
|
assert.equal(invalid.success, false);
|
|
});
|
|
|
|
test("validation helpers only export request-body helper APIs", async () => {
|
|
const helpers = await import("../../src/shared/validation/helpers.ts");
|
|
assert.equal("loginSchema" in helpers, false);
|
|
assert.equal(typeof helpers.validateBody, "function");
|
|
assert.equal(typeof helpers.isValidationFailure, "function");
|
|
});
|