illustration for An Introduction to the React Testing Library

An Introduction to the React Testing Library

Instructor

Daniel Afonso
25m closed-captioning
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
4.6
56
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!

Learner Reviews

  • Learner
    2 weeks ago
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Interesting course and easy to understand

  • lvanngo
    4 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.

  • Rafael Pereira
    4 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.

  • Jose
    6 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.

  • Jeirsen
    8 months 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

  • Federico Hernández
    10 months 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.

Course Content

25m • 22 lessons

    You might also like these resources:

    illustration for Introduction to Cloudflare Workers

    Introduction to Cloudflare Workers

    Kristian Freeman・36m・Course

    Become familiar with the Workers CLI wrangler that we will use to bootstrap our Worker project. From there you'll understand how a Worker receives and returns requests/Responses. We will also build this serverless function locally for development and deploy it to a custom domain.

    illustration for Create an eCommerce Store with Next.js and Stripe Checkout

    Create an eCommerce Store with Next.js and Stripe Checkout

    Colby Fayock・1h 4m・Course

    This is a practical project based look at building a working e-commerce store using modern tools and APIs. Excellent for a weekend side-project for your developer project portfolio

    illustration for Practical Git for Everyday Professional Use

    Practical Git for Everyday Professional Use

    Trevor Miller・1h・Course

    git is a critical component in the modern web developers tool box. This course is a solid introduction and goes beyond the basics with some more advanced git commands you are sure to find useful.