import { assertEquals } from "@std/assert"; Deno.test("mod.ts, the docs' index page, links every documented module", async () => { const doc = await Deno.readTextFile("mod.ts"); const linked = new Set( [...doc.matchAll(/\]\(\.\/(\S+?\.ts)\/index\.html\)/g)].map((m) => m[1]), ); const modules: string[] = []; async function walk(dir: string) { for await (const entry of Deno.readDir(dir)) { const path = `${dir}/${entry.name}`; if (entry.isDirectory && entry.name !== "test") await walk(path); else if (entry.name.endsWith(".ts")) modules.push(path); } } await walk("api"); await walk("shared"); assertEquals(modules.filter((m) => !linked.has(m)), []); assertEquals([...linked].filter((m) => !modules.includes(m)), []); });