When you enroll through our links, we may earn a small commission—at no extra cost to you. This helps keep our platform free and inspires us to add more value.

Udemy logo

Testing React apps with React Testing Library (RTL)

Learn how to test React components with React Testing Library, the recommended library from Facebook for testing.

     
  • 4
  •  |
  • Reviews ( 1.3K )
₹519

This Course Includes

  • iconudemy
  • icon4 (1.3K reviews )
  • icon2h 37m
  • iconenglish
  • iconOnline - Self Paced
  • iconprofessional certificate
  • iconUdemy

About Testing React apps with React Testing Library (RTL)

Welcome to testing React components with React Testing Library! In this course, you will learn lots of things. You will learn:

The principles of Test Driven Development

Know what is React Testing Library (RTL) and its differences with Enzyme (another popular test framework for React)

Understand how Create React App (CRA) works.

Understand how Jest works with RTL

How to test with RTL and query elements with:

getBy, queryBy, findBy, getAllBy, queryAllBy, findAllBy

How to simulate user interaction with the fireEvent API

How to simulate user interaction with the userEvent API

Testing components in isolation (unit tests)

Learn about coverage and debugging

How to mock 3rd party libraries like Axios and mock a GET request

Learn about the pitfalls of CRA You will have all the fundamental tools to test any React component and have that coverage at 100%! Have fun, and never stop learning!

What You Will Learn?

  • The principles of Test Driven Development (TDD) .
  • Know what React Testing Library is and its differences with Enzyme .
  • Understand how Jest works with React Testing Library .
  • Query elements with getBy, queryBy, findBy, getAllBy, queryAllBy, findAllBy .
  • Simulate user interaction with the fireEvent and userEvent API .
  • Learn about coverage and debugging .
  • How to mock third party libraries like Axios .
  • How to use Typescript with a React app.