The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { deriveWsBaseUrl, normalizeHttpBaseUrl } from "./endpoint.ts"; |
| 4 | |
| 5 | describe("advertised endpoint helpers", () => { |
| 6 | it("normalizes HTTP and WebSocket base URLs", () => { |
| 7 | expect(normalizeHttpBaseUrl("https://example.com/path?x=1#hash")).toBe("https://example.com/"); |
| 8 | expect(normalizeHttpBaseUrl("wss://example.com/socket")).toBe("https://example.com/"); |
| 9 | expect(deriveWsBaseUrl("https://example.com/api")).toBe("wss://example.com/"); |
| 10 | expect(deriveWsBaseUrl("http://127.0.0.1:3773")).toBe("ws://127.0.0.1:3773/"); |
| 11 | }); |
| 12 | }); |