15

Testing React Apps

This chapter explains the basics of testing React apps. It will give us an overview of using Jest, which is a JavaScript testing framework. We will look at how you can create and run new test suites and tests. To test our React Vite project, we will also learn how to use the React Testing Library together with Vitest.

In this chapter, we will cover the following topics:

  • Using Jest
  • Using the React Testing Library
  • Using Vitest
  • Firing events in tests
  • End-to-end testing

Technical requirements

The Spring Boot application that we created in Chapter 5, Securing Your Backend, is required, as is the React app that we used in Chapter 14, Styling the Frontend with React MUI.

The code samples available at the following GitHub link ...

Get Full Stack Development with Spring Boot 3 and React - Fourth Edition 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.