Current section: Component Testing 4 exercises

Error List Component with React Testing Library

Loading exercise


00:00 In this exercise, we're going to be testing the error list component, so it's rendering JSX. We need to be able to render that JSX in the same way that it's going to be rendered in our application, that is, to the DOM. Now, we're going to be using a library called Testing Library or React Testing Library for this.

00:17 I wrote this a few years ago to make testing React a lot easier, and it is, and it's great. So, you're going to be able to use React Testing Library to test this component. We've got a couple of cases here, so get to it.