I'd like to turn off all console.log used in the tested code using a flag.
Is there a easy way to do this?
I have already tried to override console.log in a beforeEach function but it seems doesn't work.
But if I sostitute the console.log in the test, it's work.
you could use an env variable to do it conditionally, but usually you have some kind of logging lib/object passed which you can noop in NODE_ENV=test