// @vitest-environment jsdom import { screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; // 09-03. A throw while the feature graph evaluates (a duplicate message key, // a route or operation conflict) used to stop main.tsx before boot() ran, so // the static "loading" shell stayed up forever. vi.mock("../../src/.generated/product-feature-index.ts", () => { throw new TypeError("Duplicate ko-KR message key: probe.title"); }); describe("boot entry (09-03)", () => { it("shows the boot error shell when the app graph fails to evaluate", async () => { document.body.innerHTML = '
불러오는 중
'; vi.spyOn(console, "error").mockImplementation(() => {}); await import("../../src/bootstrap/main.tsx"); const shell = await screen.findByRole("alert"); expect(shell).toHaveTextContent("애플리케이션을 시작할 수 없습니다."); expect(document.querySelector("[data-boot-shell]")).toBeNull(); }); });