date |
---|
Fri Aug 18 2017 17:12:07 GMT+1000 (AEST) |
-
don't
import jest
. Otherwise you get weird stuff likejest.fn()
not working. Thejest
object is injected as a global when you run thejest
cli. -
if you're using
afterAll
, make sure any tests with promises return the promise (to ensureafterAll
waits for things to finish) -
when doing integration tests, make sure you
--runInBand
(because otherwise changes to db will happen in an unpredictable order) -
if you're used to using
tape
, like me, beware thattest('...', (t) => { ... })
will hang because the first arg is a callback to signify done-ness: https://facebook.github.io/jest/docs/en/asynchronous.html#content