import test from "node:test";
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
const output = process.env.WAREHOUSE_EXPORT_DIR || "out";
const canonicalOrigin = "https://www\\.bluebucket\\.dev";
const page = (route) => readFile(`${output}/playground/${route}/index.html`, "utf8");
test("exported canonical article is the current Lichen study", async () => {
const html = await page("lichen");
assert.match(html, new RegExp(``, "u"));
assert.match(html, /PLAYGROUND/u);
assert.match(html, /SOURCE CODE/u);
assert.match(html, /Lichen: a field of sound\./u);
assert.match(html, /href="\/playground\/lichen\/launch\/"/u);
assert.match(html, /\/playground\/source\/lichen-v2\/manifest\.json/u);
assert.doesNotMatch(html, /\bV2\b/u);
assert.doesNotMatch(html, /Compare the original|Open the original|Original ↗/u);
assert.doesNotMatch(html, /