An Introduction to the React Testing Library

25m
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
4.5
55
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!

Instructor

Daniel Afonso

Daniel is a Developer Advocate. His current interest is in React and JavaScript, and he advocates for better testing principles using the testing library. He has a full-stack background, having worked with different languages and frameworks on various projects from IoT to Fraud Detection. In his free time, when he's not learning new technologies or writing about them, he's probably reading comics or watching superhero movies and shows.

Course content (22 lessons)

    illustration for An Introduction to the React Testing Library