docs: record frontend migration baseline
This commit is contained in:
@@ -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,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user