From 770dd37ecd11d3d413d53976f75debdca441731a Mon Sep 17 00:00:00 2001 From: StillKnotKnown Date: Mon, 16 Mar 2026 14:11:35 +0200 Subject: [PATCH] test: use resetAllMocks instead of clearAllMocks in runner-env-handlers tests Convert from clearAllMocks() to resetAllMocks() to properly reset mock implementations between tests. Tests already set up their own mock implementations, so this provides cleaner isolation. Resolves coderabbitai:comment_2939695330 --- .../github/__tests__/runner-env-handlers.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/main/ipc-handlers/github/__tests__/runner-env-handlers.test.ts b/apps/desktop/src/main/ipc-handlers/github/__tests__/runner-env-handlers.test.ts index ab543dcb..e70d32be 100644 --- a/apps/desktop/src/main/ipc-handlers/github/__tests__/runner-env-handlers.test.ts +++ b/apps/desktop/src/main/ipc-handlers/github/__tests__/runner-env-handlers.test.ts @@ -269,9 +269,8 @@ function createProject(): Project { describe('GitHub TypeScript runner usage', () => { beforeEach(() => { - // Note: Using clearAllMocks() here instead of resetAllMocks() to preserve mock implementations - // TODO: Convert to resetAllMocks() and reset implementations in beforeEach - vi.clearAllMocks(); + // Reset all mocks to clean state (resets both call history and implementations) + vi.resetAllMocks(); mockIpcMain.reset(); projectRef.current = createProject(); });