Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142239

Does Jest swallow console.log statements? Is there a way to change this?

$
0
0

Does Jest swallow console.log output?

// __tests__/log.test.js

it('logs', () => {
  console.log('hey') // expect to see "hey" printed in terminal
})

// terminal output
$ jest --forceExit
PASS  __tests__/log.test.js
✓ logs (1ms) # where's "hey"?

The main reason I care is that I'm writing some async beforeAll and afterAll stuff, and I want to use console.log statements to debug the order of events.


Viewing all articles
Browse latest Browse all 142239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>