Keeping things simple and lean
npm run test:snapshot
to generate new snapshots!
npm run test
for a regular testnpm run test:watch
watch your project for changes to test files and the program files that they cover
npm run test:100
for a test with code coveragenpm run test:report
to see the open coverage report in a browser window
There are various problems with Jest:
- Takes over Node.js globals! 🔥
- It runs tests in copied/hacked Node.js environment which introduces some issues (not patchable)
stdout
andstderr
are output of out sync facebook/jest#6718- Some public Node.js API's are replaced with non standard alternatives -> facebook/jest#67256725
- Due to non standard and uneven modules cache handling it's prone to OOM errors: facebook/jest#6399 (comment)
- Tests progress is not output until tests finalize, which is inconvenient in long going tests (as integration ones) -> facebook/jest#6616 (not easily patchable)
- Any stdout/stderr output is hidden until test finalizes -> [jestjs/jest#5281 (patchable with
useStderr
option)](https://github.com/facebook/jest#5281 (patchable with useStderr/issues/)option) - Default runner exposes various bugs (patchable via using alternative
jest-circus
runner)- Crashes in
beforeAll
do not prevent execution of tests -> facebook/jest#2713, facebook/jest#6695 - Crashes in
afterAll
are not exposed -> facebook/jest#66926692 only
andskip
are not fully respected -> facebook/jest#41664166
- Crashes in
- Source code is result of transpilation which makes it more difficult to debug eventual issues