Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 705 Bytes

18-017.md

File metadata and controls

13 lines (8 loc) · 705 Bytes
date
Fri Aug 18 2017 17:12:07 GMT+1000 (AEST)

jest

  • don't import jest. Otherwise you get weird stuff like jest.fn() not working. The jest object is injected as a global when you run the jest cli.

  • if you're using afterAll, make sure any tests with promises return the promise (to ensure afterAll 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 that test('...', (t) => { ... }) will hang because the first arg is a callback to signify done-ness: https://facebook.github.io/jest/docs/en/asynchronous.html#content