Investigate using --silent
flag in jest
instead of mocking console.{log,warn,error}
#4511
Milestone
--silent
flag in jest
instead of mocking console.{log,warn,error}
#4511
This would prevent a lot potentially useful log statements being hidden by use of global
console.log = jest.fn()
like we have in many places throughout the tests. At dev time we would see them by default, at CI time we can globally hide all log statements in terminal output.Instead of using
console.log = jest.fn()
in most of those places, we should probably instead be callingconst consoleLogSpy = jest.spyOn(console, 'log')
andconsoleLogSpy.mockRestore()
when we are done. This will ensure that our spying does not interfere with default logging behavior while simultaneously allowing us to ignore it with--silent
in CI.The text was updated successfully, but these errors were encountered: