From fca316f7b0377705051d2ad007b757ad0d86aa7e Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Fri, 24 May 2024 12:17:24 +0900 Subject: [PATCH] chore(tests): suppress error log (#2571) --- .../react/vanilla-utils/atomWithObservable.test.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/react/vanilla-utils/atomWithObservable.test.tsx b/tests/react/vanilla-utils/atomWithObservable.test.tsx index 9b239964e0..0fd7a54591 100644 --- a/tests/react/vanilla-utils/atomWithObservable.test.tsx +++ b/tests/react/vanilla-utils/atomWithObservable.test.tsx @@ -18,16 +18,16 @@ beforeEach(() => { performance.clearMarks = (() => {}) as any performance.clearMeasures = (() => {}) as any } - // suppress ErrorBoundary error log - console.error = vi.fn((message: unknown, ...optionalParams: unknown[]) => { + // suppress error log + console.error = vi.fn((...args: unknown[]) => { + const message = String(args) if ( - typeof message === 'string' && - (message.includes('Error: Uncaught [Error: Test Error]') || - message.includes('at ErrorBoundary')) + message.includes('at ErrorBoundary') || + message.includes('Test Error') ) { return } - return consoleError(message, ...optionalParams) + return consoleError(...args) }) })