Delightful JavaScript Testing
open sourceMITself-hostablefree
Jest is a JavaScript testing framework that works out of the box for most projects: a test runner, assertions, mocks and coverage in one package. Its watch mode reruns only the test files related to what changed, and snapshot testing records large objects or rendered output so later changes show up as diffs. Tests run in parallel in separate processes, previously failed tests run first, and coverage needs only --coverage. It's an OpenJS Foundation project.
Problems it solves
- set up unit tests for a JavaScript project without wiring together five libraries
- rerun only the tests affected by the file I just changed
- catch unexpected changes in a component's rendered output
- mock a module in my JavaScript tests
- measure test coverage for a TypeScript project
- test React components and plain functions with the same tool
- a test runner for Node.js that runs test files in parallel
Features
- zero-config setup for most projects
- interactive watch mode
- snapshot testing
- mocks and spies
- code coverage with --coverage
- tests isolated in parallel processes
- failed tests first, ordered by duration
Capabilities
| Has a command line tool | plan not known |
|---|---|
| Takes plugins | plan not known |
Alternatives
The same job
These do what Jest does.
