© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
J. QiuTest-Driven Development with Reacthttps://doi.org/10.1007/978-1-4842-6972-5_2

2. Get Started with Jest

Juntao Qiu1  
(1)
Burwood East, 3151, Victoria, Australia
 

In this chapter, we’re going to learn some concepts and features about jest – a JavaScript testing framework – such as different types of matchers, the powerful and flexible expect, the extremely useful mock for unit testing, and so on. Additionally, we will learn how to arrange our test suite in an easy-to-maintain manner and leverage the best practices from real-world projects.

Firstly, you will see how to set up your environment to write our first test. We will be using ES6 as the primary programming ...

Get Test-Driven Development with React: Apply Test-Driven Development in Your Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.