From 8fb22b89cfb718b51468d9c115a06fabcb7a69af Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 4 Apr 2026 17:04:26 +0900 Subject: [PATCH] fix(test): restore real executor module in auto-slash-command-leak afterAll mock.module('./executor') in auto-slash-command-leak.test.ts was leaking into executor-resolution.test.ts in the same CI batch run, causing executeSlashCommand to return the mock's raw replacement instead of the real resolution result. Fix: re-register the real executor exports via mock.module() in afterAll so subsequent test files in the batch get the real implementation. --- .../auto-slash-command/auto-slash-command-leak.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/auto-slash-command/auto-slash-command-leak.test.ts b/src/hooks/auto-slash-command/auto-slash-command-leak.test.ts index 894981afa..e82ae313e 100644 --- a/src/hooks/auto-slash-command/auto-slash-command-leak.test.ts +++ b/src/hooks/auto-slash-command/auto-slash-command-leak.test.ts @@ -19,8 +19,12 @@ mock.module("./executor", () => ({ executeSlashCommand: executeSlashCommandMock, })) -afterAll(() => { +afterAll(async () => { mock.restore() + // Restore the real executor module so subsequent test files in the same batch + // (e.g. executor-resolution.test.ts) don't get the mocked version + const realExecutor = await import("./executor") + mock.module("./executor", () => realExecutor) }) const logMock = spyOn(shared, "log").mockImplementation(() => {})