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.tngl.boltless.dev", "did:web:migrator.tngl.boltless.dev"], ["https://migrator.tngl.boltless.dev/", "did:web:migrator.tngl.boltless.dev"], ["http://knot.oyster.cafe:8443", "did:web:knot.oyster.cafe%3A8443"] ])("maps %s to %s", (input, expected) => { expect(serviceDidForHost(input)).toBe(expected); });
test("round-trips with hostForServiceDid", () => { const host = "migrator.tngl.boltless.dev"; expect(hostForServiceDid(serviceDidForHost(host))).toBe(host); });});