The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { assert, it } from "@effect/vitest"; |
| 2 | |
| 3 | import { |
| 4 | repositoryPathFromRemoteUrl, |
| 5 | transportSafeSourceControlErrorValue, |
| 6 | } from "./SourceControlProvider.ts"; |
| 7 | |
| 8 | it("removes URL credentials, query parameters, and fragments from error transport values", () => { |
| 9 | assert.strictEqual( |
| 10 | transportSafeSourceControlErrorValue( |
| 11 | "https://user:secret@example.test/org/repo/pull/42?token=secret#discussion", |
| 12 | ), |
| 13 | "https://example.test/org/repo/pull/42", |
| 14 | ); |
| 15 | }); |
| 16 | |
| 17 | it.each([ |
| 18 | ["git@github.com:T3Tools/t3code.git", "T3Tools/t3code"], |
| 19 | ["github.com:T3Tools/t3code.git", "T3Tools/t3code"], |
| 20 | ["gitlab.com:T3Tools/platform/t3code", "T3Tools/platform/t3code"], |
| 21 | ["https://github.com/T3Tools/t3code.git", "T3Tools/t3code"], |
| 22 | ["https://github.com/T3Tools/t3code.git?view=compact", "T3Tools/t3code"], |
| 23 | ["https://github.com/T3Tools/t3code.git#section", "T3Tools/t3code"], |
| 24 | ["C:/repos/t3code", null], |
| 25 | ])("reads the repository path of %s", (remoteUrl, expected) => { |
| 26 | assert.strictEqual(repositoryPathFromRemoteUrl(remoteUrl), expected); |
| 27 | }); |