refactor: convert map feature to strict TypeScript
This commit is contained in:
@@ -7,6 +7,8 @@ import test from "node:test";
|
||||
import { readFile } from "node:fs/promises";
|
||||
|
||||
const indexPath = new URL("../../assets/web/index.html", import.meta.url);
|
||||
const pluginLoaderPath = new URL("../src/plugin-loader.ts", import.meta.url);
|
||||
const mapCorePath = new URL("../src/map-core.ts", import.meta.url);
|
||||
|
||||
test("index loads the shared UI before the application", async () => {
|
||||
const html = await readFile(indexPath, "utf8");
|
||||
@@ -26,3 +28,14 @@ test("startup has no remote script or stylesheet dependencies", async () => {
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test("lazy frontend features use modules and local map symbols", async () => {
|
||||
const [loader, map] = await Promise.all([
|
||||
readFile(pluginLoaderPath, "utf8"),
|
||||
readFile(mapCorePath, "utf8"),
|
||||
]);
|
||||
assert.equal(loader.includes("createElement(\"script\")"), false);
|
||||
assert.match(loader, /import\(path\)/);
|
||||
assert.match(map, /aprs-symbol-local/);
|
||||
assert.equal(map.includes("raw.githubusercontent.com"), false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user