From the course: Learning End-to-End Testing with Jest
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Introduction to Jest
From the course: Learning End-to-End Testing with Jest
Introduction to Jest
- Jest is a wonderful testing library created by Facebook to help test JavaScript code. And it does not require a lot of configuration for FaceTime users, as we will see in the next video. Mocha is an alternative and just like Jest it has assertion, but requires another package such as Sinon for mocking and spying, Jest comes bonded with some interesting features like keeping track of large objects with ease using snapshots. It has built-in test runner, assertion library, mocking supports, and a tool for code coverage. Jest is compatible with Node.js, React, Angular, Vue.js, and other Babel-based projects. And has a similar syntax to all that testing, assertion libraries like Jasmine and Chai. But with Jest, your tests run in parallel, so they are executed much faster than other testing frameworks. Testing is really easy. If you can think of it as taking an inputs, defining what to expect as the outputs, and finally assert…