test: prove TechLog UI migration parity

This commit is contained in:
DongHyeonka
2026-08-16 02:48:26 +09:00
parent c5c8b9423c
commit 6c2780b7a7
176 changed files with 2393 additions and 616 deletions
+55
View File
@@ -0,0 +1,55 @@
import { describe, expect, it } from "vitest";
import { findViteDynamicRouteChunk } from "../../scripts/lib/vite-route-chunks.ts";
describe("Vite route chunk identity", () => {
it("recognizes a governed manual chunk referenced by an entry dynamic import", () => {
const manifest = {
"_route-tech-log-home-abc.js": {
file: "assets/route-tech-log-home-abc.js",
name: "route-tech-log-home",
},
"index.html": {
file: "assets/index.js",
name: "index",
isEntry: true,
dynamicImports: ["_route-tech-log-home-abc.js"],
},
};
expect(findViteDynamicRouteChunk(manifest, "route-tech-log-home")).toEqual({
file: "assets/route-tech-log-home-abc.js",
name: "route-tech-log-home",
});
});
it("retains Vite native dynamic-entry support", () => {
const manifest = {
"src/page.tsx": {
file: "assets/page.js",
name: "route-page",
isDynamicEntry: true,
},
};
expect(findViteDynamicRouteChunk(manifest, "route-page")?.file).toBe(
"assets/page.js",
);
});
it("rejects a named chunk that is not dynamically reachable", () => {
const manifest = {
"_route-tech-log-home-abc.js": {
file: "assets/route-tech-log-home-abc.js",
name: "route-tech-log-home",
},
"index.html": {
file: "assets/index.js",
name: "index",
isEntry: true,
},
};
expect(findViteDynamicRouteChunk(manifest, "route-tech-log-home")).toBeUndefined();
});
});