-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Learn React with TypeScript
By :

In this chapter, we will learn how to use Vitest and the 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 Vitest and using it to test simple functions, learning about Vitest’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 the 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 about the most accurate way to simulate user interactions using a React Testing Library companion package. We use this to create tests for items being checked in the checklist component.
At the end of the chapter, we will learn how to determine...