I'm interested in testing the foo function with Jest. This function contains a console.log statement within it. Is it feasible to configure Jest so that it only displays the console.log output when a test fails?
function foo() {
...
console.log(...);
...
}
describe('....', () => {
test(`...`, () => {
const results = foo();
expect(.........);
});