From 55778583b98ee07922024fcb8946e06542bb86b4 Mon Sep 17 00:00:00 2001 From: Cynthia Long Date: Mon, 16 Mar 2026 22:04:06 +0000 Subject: [PATCH] update test --- packages/cli/src/ui/utils/ConsolePatcher.test.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/cli/src/ui/utils/ConsolePatcher.test.ts b/packages/cli/src/ui/utils/ConsolePatcher.test.ts index 59a73e7e37..152c3eaf5b 100644 --- a/packages/cli/src/ui/utils/ConsolePatcher.test.ts +++ b/packages/cli/src/ui/utils/ConsolePatcher.test.ts @@ -24,12 +24,8 @@ describe('ConsolePatcher', () => { }); it('should suppress output when suppressConsoleOutput is true and debugMode is false', () => { - // We need to spy on the original console methods that ConsolePatcher will call - // ConsolePatcher captures the original methods at construction time or patch time? - // It captures them at construction time. - - const originalLog = console.log; - const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); + const originalError = console.error; + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); patcher = new ConsolePatcher({ debugMode: false, @@ -40,11 +36,11 @@ describe('ConsolePatcher', () => { console.log('test log'); - expect(logSpy).not.toHaveBeenCalled(); + expect(errorSpy).not.toHaveBeenCalled(); patcher.cleanup(); - logSpy.mockRestore(); - console.log = originalLog; + errorSpy.mockRestore(); + console.error = originalError; }); it('should NOT suppress output when suppressConsoleOutput is true but debugMode is true', () => {