react-testing-library

Simple and complete React DOM testing utilities that encourage good testing practices. More info

Articles & Tutorials

Successful Refactoring with React Testing Library (blog.logrocket.com)
Mar 15, 2021
In this article, we’ll take a look at a simple React component and observe how our test suite responds to simple refactors. We’ll use React Testing Library to highlight the power of testing how the user interacts with the app.
  • Tyler Hawkins
React Testing Library – Tutorial with JavaScript Code Examples (freecodecamp.org)
Mar 07, 2021
This post will help you to learn what the React Testing Library is, and how you can use it to test your React application.
  • Nathan Sebhastian
Testing apps with Jest and React Testing Library (blog.logrocket.com)
Mar 01, 2021
In this article, we’ll test React applications with Jest and React Testing Library, a popular combination of a JavaScript testing framework and a React utility for testing components.
  • Juan Cruz Martinez
Testing UI - Next JS, Typescript, Jest and React Testing Library (dev.to)
Nov 10, 2020
As you know, React is just JavaScript. That means it can be tested just like any other JS application. There are lots of testing libraries and test runners out there, but I find that the best setup is Jest + React Testing Library.
  • Maciek Grzybek
How to build a search bar in React (emgoto.com)
Nov 06, 2020
A search bar is a great way to make content on your website discoverable. In this tutorial, we’ll be building an accessible search bar component using React. We’ll also be adding a couple of unit tests with React Testing Library.
  • Emma Goto
How to unit test your Gatsby blog with React Testing Library (emgoto.com)
Oct 16, 2020
Writing unit tests will keep your Gatsby blog bug-free, and leads to more maintainable code. This post covers how you can use Jest and React Testing Library to cover some of your Gatsby blog’s most essential features.
  • Emma Goto
A low-friction way to do TDD with React (blog.logrocket.com)
Aug 17, 2020
This tutorial shows you how and why to use React Testing Library for low-friction Test Driven Development (TDD).
  • Jeff Auriemma
Testing with react-testing-library and Jest (blog.bitsrc.io)
Aug 04, 2020
In this post, we’ll look at two libraries that enable us to carry out UI testing in our React application.
  • Chidume Nnamdi
How To Test Your React Apps With The React Testing Library (smashingmagazine.com)
Jul 03, 2020
In this article, we’re going to show how React developers can quickly start testing their app with the React Testing Library (RTL).
  • Chidi Orji
Stop mocking fetch (kentcdodds.com)
Jun 08, 2020
Why you shouldn't mock fetch or your API Client in your tests and what to do instead.
How to use React Testing Library Tutorial (robinwieruch.de)
Jun 01, 2020
In this React Testing Library tutorial, we will go through all the steps necessary to unit test and integration test your React components with confidence.
React Native Testing Library 2.0 – What’s New? (callstack.com)
May 28, 2020
We are happy to announce the release of version 2.0 of React Native Testing Library. For the last couple of weeks, we’ve been working really hard to bring you useful new features and to polish our APIs and their documentation, as well as improve compatibility with other Testing Library implementations.
  • Michał Pierzchała
Common mistakes with React Testing Library (kentcdodds.com)
May 05, 2020
Some mistakes I frequently see people making with React Testing Library.
Enzyme vs. react-testing-library: A mindset shift (blog.logrocket.com)
May 04, 2020
In a world of myriad tools, it can be difficult to choose the one best suited for your purposes in different scenarios.
  • Will Soares
How to Start Testing Your React Apps Using the React Testing Library and Jest (freecodecamp.org)
Mar 12, 2020
Testing is often seen as a tedious process. It's extra code you have to write, and in some cases, to be honest, it's not needed. But every developer should know at least the basics of testing. It increases confidence in the products they build, and for most companies, it's a requirement.
  • Ibrahima Ndaw
Semantic tests with React Testing Library (blog.logrocket.com)
Feb 21, 2020
Testing code can be a controversial subject, largely due to the multitude of ways one can go about writing a test.
  • Rafael Quintanilha
Testing React Hooks With Enzyme and React Testing Library (css-tricks.com)
Nov 29, 2019
In this tutorial, we will look at how to do that by making use of a to-do application built with hooks. We’ll cover writing of tests using Ezyme and React Testing Library, both of which are able to do just that.
  • Kingsley Silas
How to test your React apps with the React Testing Library (freecodecamp.org)
Oct 09, 2019
Building web applications is not an easy task as of today. To do so, you're probably using something like React, Vue or Angular. Your app is faster, and the code is both more maintainable and readable.
  • Thomas Lombart
Getting Started with React Testing Library (css-tricks.com)
May 22, 2019
We’re going to spend some time writing tests together using react-testing-library for a light to-do application I built.
  • Kingsley Silas
My experience moving from Enzyme to react-testing-library (medium.com)
May 21, 2019
Hopefully, this post can help you understand some key differences between the two libraries and inspire you to explore them for yourself.
  • David Boyne
Testing Stateful React Function Components with React Testing Library (robertcooper.me)
Apr 08, 2019
In this post, I'll look at an example stateful function component that is tested with react-testing-library. I'll also write the same component into its class component equivalent and show how the class component can be tested with enzyme.
  • Robert Cooper
Async Axios in React Testing Library (leighhalliday.com)
Mar 07, 2019
In this article we'll take a look at how to handle async code in React Testing Library, specifically at how to test and mock a call using Axios.
Firing Events in React Testing Library (leighhalliday.com)
Mar 07, 2019
In this article we'll see how to fire and test events in our React components using the React Testing Library.
Async MobX in React Testing Library (leighhalliday.com)
Mar 07, 2019
In this article we'll take a look at how to handle async code in React Testing Library, specifically at how to test and mock a call using Axios.
Testing React components (flaviocopes.com)
Jan 05, 2019
Test your first React component using Jest and `react-testing-library`
Introducing the react-testing-library (blog.kentcdodds.com)
Apr 02, 2018
A simpler replacement for enzyme that encourages good testing practices.

Video Guides & Talks

What Is React Native Testing Library (youtube.com)
Aug 18, 2020
In this video Mike Grabowski and Mike Pierzchała talk about the React Native Testing Library.
  • Mike Grabowski
  • Mike Pierzchała
Working on Testing Library and Epic React (youtube.com)
May 05, 2020
Just thought I'd stream a bit of my work today for Testing Library and Epic React.
How I like to Write Integration Tests in React (youtube.com)
Jun 15, 2019
I share how I like to write integration tests in React with React Testing Library and Apollo.
React Testing Library - Testing Redux (youtube.com)
Mar 02, 2019
In this video we'll see how to test using Redux and connected components with the React Testing Library.
React Testing Library - Testing a mock Axios request (youtube.com)
Feb 13, 2019
In this video we look at how to test a component with react testing library which contains an asynchronous Axios request that we'll mock out using Jest mocks.
Updating react-testing-library for React 16.8.0 (part 2) (youtube.com)
Feb 06, 2019
Hooks was released along with a special utility for testing React properly. I'm going to update react-testing-library to make it easier for people to test things properly.
Updating react-testing-library for React 16.8.0 (youtube.com)
Feb 05, 2019
React has a new utility for testing and I'm going to update react-testing-library to use that utility.
React Testing Library - Events and Async (youtube.com)
Jan 31, 2019
In this video we'll see how to fire events (click) and how to wait for elements to appear on the screen when the code is asynchronous.
Intro to React Testing Library (youtube.com)
Jan 29, 2019
We'll investigate how to easily test our React components using the React Testing Library an alternative to Enzyme that works alongside Jest. This is an introduction, covering installation, snapshots, finding elements and verifying certain attributes on those elements.
React Hooks & testing: Stepping through React code (youtube.com)
Nov 05, 2018
I'm trying to figure out the best way to simplify testing of React components with react-testing-library.
What Is React Testing Library? (youtube.com)
Aug 29, 2018
In this video I talk about what is React Testing Library and why you might want to use it.
Component Unit Testing (and mocking) with react-testing-library (youtube.com)
Jun 22, 2018
Lots of people make the assumption that react-testing-library is good for React component integration testing, but not very useful for unit testing because it (intentionally) doesn't support shallow rendering. Let's see how you can do unit testing with react-testing-library
render React Components with react-testing-library (youtube.com)
Jun 19, 2018
Now there's only one way to do it, but it can be customized to suite your needs.
Test Driven Development with react-testing-library (youtube.com)
May 22, 2018
The react-testing-library is a very light-weight solution for testing React components.

Courses & Video Series