20 lines
666 B
TypeScript
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)}`,
|
|
);
|
|
});
|