test(boot): 예상 밖 부팅 실패 테스트가 바꾼 전역 reportError를 되돌린다
문제 tests/component/boot-unexpected-failure.test.tsx는 vi.stubGlobal로 reportError를 바꾸고 되돌리지 않는다. 설정에 unstubGlobals가 없어서 그 stub이 같은 파일의 다음 테스트에 남는다. 고른 방법 - 이 파일에 afterEach(vi.unstubAllGlobals)를 둔다. 전역 설정 (unstubGlobals: true)은 다른 파일의 동작까지 바꾸므로 고르지 않았다. 검증 - 파일 2건 통과, eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/10-tests-fast-layers.md (2절 boot-unexpected-failure stubGlobal)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// @vitest-environment jsdom
|
||||
|
||||
import { render, screen, within } from "@testing-library/react";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { BootErrorShell } from "../../src/presentation/boundaries/boot-error-shell.tsx";
|
||||
|
||||
@@ -16,6 +16,12 @@ vi.mock("../../src/bootstrap/create-runtime-composition.ts", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
// The reportError stub must not reach the next test in this file; the config
|
||||
// does not set unstubGlobals.
|
||||
afterEach(() => {
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
describe("unexpected boot failure (09-04)", () => {
|
||||
it("is shown as BOOT_UNEXPECTED_FAILURE and reports the error in development", async () => {
|
||||
document.body.innerHTML =
|
||||
|
||||
Reference in New Issue
Block a user