illustration for An Introduction to the React Testing Library

An Introduction to the React Testing Library

Instructor

Daniel Afonso
25m
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
4.5
58
people completed
Bookmark
Download
RSS

In 2018, Kent C. Dodds wrote: "The more your tests resemble the way your software is used, the more confidence they can give you." This phrase became the guiding principle for the entire Testing Library ecosystem.

A few years later, the React Testing Library became the de facto library for writing unit and integration tests in the React ecosystem.

Thanks to its user-centric perspective, our tests are closer to our user experience and far away from implementation details.

In this course, you will learn how to:

  • render your components
  • properly query your UI for elements while keeping accessibility and your users' experience in mind
  • improve your testing experience with the usage of some utilities
  • interact with your components to fire events
  • leverage asynchronous utilities to customize your testing flow
  • get rid of the annoying "not wrapped in act" warning

After this course, you should be able to write and debug any test using the React Testing Library!

Course Content

25m • 22 lessons