docs: record frontend migration baseline

This commit is contained in:
sjg
2026-08-01 12:09:38 +02:00
parent e6f593b959
commit 42e5dc8604
2 changed files with 65 additions and 1 deletions
@@ -6,7 +6,21 @@ import assert from "node:assert/strict";
import test from "node:test";
import { readFile } from "node:fs/promises";
const indexPath = new URL("../../assets/web/index.html", import.meta.url);
test("index loads the shared UI before the application", async () => {
const html = await readFile(new URL("../../assets/web/index.html", import.meta.url), "utf8");
const html = await readFile(indexPath, "utf8");
assert.ok(html.indexOf("/ui-core.js") < html.indexOf("/app.js"));
});
test("startup has no remote script or stylesheet dependencies", async () => {
const html = await readFile(indexPath, "utf8");
const assetReferences = Array.from(
html.matchAll(/<(?:script|link)\b[^>]+(?:src|href)="([^"]+)"/g),
(match) => match[1],
);
assert.equal(
assetReferences.some((reference) => /^https?:\/\//i.test(reference)),
false,
);
});