fmdatalab
Explore posts from serversTTCTheo's Typesafe Cult
•Created by fmdatalab on 4/24/2024 in #questions
Large number of Vercel Edge Middleware Invocations coming from next-auth's `/api/auth/session`
1 replies
TTCTheo's Typesafe Cult
•Created by fmdatalab on 1/8/2023 in #questions
Hide console.error when mocking error response in jest?
I'm writing a few client-side unit tests and want to assert what happens when an error is returned from the procedure.
My tests pass ok, but I end up with a wall of
console.error
's when I do so.
I don't want to mock the return value of console.error
so that it never fires, as there may be some valid errors that are thrown that I want to catch, especially when running my tests on my CI/CD.
Is there any other way to prevent the console.error
from logging when a procedure throws an error?
I've tried updating my loggerLink
in my config during testing so that it is disabled, like so;
While this does clear the likes of the following console.error
's
I will still get the likes of
Any help would be greatly appreciated!3 replies