It seems that some combination of --silent=false
or maybe --verbose=false
is needed to get console.log
output from Jest. But none of these options seems to help (in Jest 29.3
) when my test fails (i.e., throws an error):
test('console output', () => {
console.log('this never prints')
throw new Error('but why?!?') // or 'expect(true).toBe(false)'
})
Why, oh why, Jest, do you do this? A failing test is exactly when I need console (i.e. debugging) output the most.
How can I see console.log
output regardless of whether something in the test throws an error?