From 84073897c6bccb3a8d4235bec96bc874b18861b7 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 11 May 2026 08:50:59 +0900 Subject: [PATCH] test(installer): stabilize timeout signal escalation assertion --- src/cli/config-manager/opencode-binary.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cli/config-manager/opencode-binary.test.ts b/src/cli/config-manager/opencode-binary.test.ts index fb64de7ed..ec7b05f35 100644 --- a/src/cli/config-manager/opencode-binary.test.ts +++ b/src/cli/config-manager/opencode-binary.test.ts @@ -86,17 +86,18 @@ describe("getOpenCodeVersion (installer)", () => { }), ) - const setTimeoutSpy = spyOn(globalThis, "setTimeout").mockImplementation((handler: TimerHandler) => { + const immediateSetTimeout = ((handler: TimerHandler) => { if (typeof handler === "function") { handler() } return 1 as unknown as ReturnType - }) + }) as unknown as typeof globalThis.setTimeout + const setTimeoutSpy = spyOn(globalThis, "setTimeout").mockImplementation(immediateSetTimeout) const result = await getOpenCodeVersion() expect(result).toBe(null) - expect(killCalls).toEqual(["SIGTERM", "SIGKILL", "SIGTERM", "SIGKILL"]) + expect(killCalls).toEqual(["SIGTERM", "SIGKILL"]) setTimeoutSpy.mockRestore() })