From the course: React: Testing and Debugging

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Test numbers with matchers

Test numbers with matchers - React.js Tutorial

From the course: React: Testing and Debugging

Start my 1-month free trial

Test numbers with matchers

- [Instructor] Now, let's move on to Jest. Jest brings dozens of methods to support most of our testing needs. So, we'll start by using a few methods to test numbers within our application. So, the first thing you're going to do is make sure that your application is running. So, we're going to do npm start, and what we're going to do now is make sure that we know or understand how many elements that we have in our course here, so we can test the amount of data that we have in our application. So, what we're going to do is bring up the developer tools, like so. So, you can click on the three dots on the right corner, More tools, and then Developer tools, or you can use Control + Shift + I, or Command + Shift + I on a Mac to bring up the developer tools. And now, we're going to go into the components. And, as we can see, we have 12 elements in our grid. So, if you want to check the actual state, you can click on the app…

Contents