Files
t3code/apps/server/src/sourceControl/SourceControlProvider.test.ts
T
2026-06-20 12:32:34 -07:00

20 lines
666 B
TypeScript

import { assert, it } from "@effect/vitest";
import { transportSafeSourceControlErrorValue } from "./SourceControlProvider.ts";
it("removes URL credentials, query parameters, and fragments from error transport values", () => {
assert.strictEqual(
transportSafeSourceControlErrorValue(
"https://user:[email protected]/org/repo/pull/42?token=secret#discussion",
),
"https://example.test/org/repo/pull/42",
);
});
it("normalizes control characters and bounds error transport values", () => {
assert.strictEqual(
transportSafeSourceControlErrorValue(` owner/repo\n\t${"x".repeat(300)} `),
`owner/repo ${"x".repeat(245)}`,
);
});