March 2023
Intermediate to advanced
474 pages
8h 54m
English
In this chapter, we learn how to use Jest and React Testing Library, two popular automated testing tools that can be used together in React applications. We will create tests on the checklist component we created in Chapter 11, Reusable Components.
We will start by focusing on Jest and using it to test simple functions, learning about Jest’s common matcher functions for writing expectations, and how to execute tests to check whether they pass.
We will then move on to learning about component testing using React Testing Library. We’ll understand the different query types and variants and how they help us create robust tests.
After that, we will learn the most accurate way to simulate user interactions ...
Read now
Unlock full access