Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
123456789101112131415161718import { describe, expect, test } from "vitest";import { hostForServiceDid, serviceDidForHost } from "$lib/auth/agent";
describe("serviceDidForHost", () => { test.each([ ["migrator.example.com", "did:web:migrator.example.com"], ["https://migrator.example.com/", "did:web:migrator.example.com"], ["http://knot.example.com:8443", "did:web:knot.example.com%3A8443"] ])("maps %s to %s", (input, expected) => { expect(serviceDidForHost(input)).toBe(expected); });
test("round-trips with hostForServiceDid", () => { const host = "migrator.example.com"; expect(hostForServiceDid(serviceDidForHost(host))).toBe(host); });});