Skip to content

Commit

Permalink
chore(tests): suppress error log (#2571)
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored May 24, 2024
1 parent 6702f79 commit fca316f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/react/vanilla-utils/atomWithObservable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})

Expand Down

0 comments on commit fca316f

Please sign in to comment.