From 1b1d972acda3dd6614d7abab23ff5977eafd8ad1 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:23:37 +0900 Subject: [PATCH] =?UTF-8?q?test(boot):=20=EC=98=88=EC=83=81=20=EB=B0=96=20?= =?UTF-8?q?=EB=B6=80=ED=8C=85=20=EC=8B=A4=ED=8C=A8=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EA=B0=80=20=EB=B0=94=EA=BE=BC=20=EC=A0=84=EC=97=AD=20?= =?UTF-8?q?reportError=EB=A5=BC=20=EB=90=98=EB=8F=8C=EB=A6=B0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 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) --- tests/component/boot-unexpected-failure.test.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/component/boot-unexpected-failure.test.tsx b/tests/component/boot-unexpected-failure.test.tsx index 9da395bb..f5800893 100644 --- a/tests/component/boot-unexpected-failure.test.tsx +++ b/tests/component/boot-unexpected-failure.test.tsx @@ -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 =