import assert from "node:assert/strict"; import { suite, test } from "node:test"; import { resolveRefs } from "./resolve-refs.js"; import type { Element } from "antihtml"; suite("function resolveRefs", () => { test("root to root relative href", () => { const el = resolveRefs(Link, "/"); assert.equal((el as Element).attributes.get("href"), "page.html"); }); test("root to subdir relative href", () => { const el = resolveRefs(Link, "/"); assert.equal((el as Element).attributes.get("href"), "dir/page.html"); }); test("subdir to root relative href", () => { const el = resolveRefs(Link, "/subdir"); assert.equal((el as Element).attributes.get("href"), "../page.html"); }); test("subdir to subdir relative href", () => { const el = resolveRefs(Link, "/subdir"); assert.equal((el as Element).attributes.get("href"), "../alt/page.html"); }); test("nested element", () => { const el = resolveRefs(