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) }) })