From the react docs on Error Boundaries:
React 16 prints all errors that occurred during rendering to the console in development, even if the application accidentally swallows them.
Due to the above I am getting loads of unnecessary console errors when running my tests. Is it possible to hide these in Jest, without mocking/spying on console.error?
Right.. Keeping the test output clean is always a good idea. Without mocking and spying - no idea but this is my version of mocking spying.
In this case there are two steps. One is quite obvious: to filter the console output. In the test initialization file, which is something like this:
There is my code for errors and warnings filtering.
And then if you have JSDOM you have to mock the virtual console. I'd prefer to do this in the test cause you might not have too many Boundary tests.