Built on top of the Jasmine test framework, using familiar expect(value).toBe(other) assertions
Automatically mocks CommonJS modules returned by require(), making most existing code testable
DOM APIs are mocked and tests run in parallel via a small node.js command line utility
Consider a scenario where you want to test the following sum.js
file:
We can get up and running with the following 4 steps:
Create a directory __tests__/
with a file sum-test.js
Run npm install jest-cli --save-dev
Add the following to your package.json
Run npm test