From the course: React: Testing and Debugging
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Test numbers with matchers - React.js Tutorial
From the course: React: Testing and Debugging
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Test strings with matchers3m 46s
-
(Locked)
Test numbers with matchers5m 46s
-
(Locked)
Solution: Test numbers with matchers3m 17s
-
(Locked)
Test arrays and objects with matchers7m 32s
-
(Locked)
Solution: Test object with matchers3m 8s
-
(Locked)
Code coverage reports3m 15s
-
(Locked)
Snapshot testing with Jest5m 13s
-
(Locked)
Organize your tests with describe()4m 51s
-
(Locked)
-
-
-