illustration for An Introduction to the React Testing Library
pro

An Introduction to the React Testing Library

Instructor

Daniel Afonso

25m closed-captioning
·
22 lessons
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
4.5
64
people completed
Published a year ago
|
Updated a year ago

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!

Learner Reviews

  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Interesting course and easy to understand

    Learner
    7 months ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Verry succinct and to the point.

    lvanngo
    10 months ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    It's good but it could be more complex including examples for mock endpoints call or even showing more error cases.

    Rafael Pereira
    10 months ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    I learned RTL by osmosis in an existing codebase. This course helped cement the concepts and add a few pointers for writing test code quicker next time. There were a few things I had not seen before. The last video on the use of act is perhaps the most challenging one to wrap my head around.

    Jose
    a year ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Basic but straight to the point, I think Daniel explain very well all these basic concepts. Looking forward for a more advanced course

    Jeirsen
    a year ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Clear and concise valuable info. Great explanation of each of the methods and how to use the testing library.

    Federico Hernández
    a year ago

Course Content

25m • 22 lessons

    You might also like these resources:

    illustration for The Beginner's Guide to React
    Kent C. Dodds • 2h 29m • Course

    This course is for React newbies and anyone looking to build a solid foundation. It’s designed to teach you everything you need to start building web apps in React right away.

    illustration for Full Stack with React and Appwrite

    Build full stack applications in React powered by Appwrite

    illustration for Secure React User Authentication with Auth0
    Will Johnson • 24m • Course

    Learn to build secure authentication for your React app with Auth0. Protect routes, personalize your UI, and use Auth0's React SDK for a seamless login/signup experience.