Jest matchers are perfect to test strings in your application. In this video, Emmanuel Henri explores the types of tests you can do with Jest's matchers for strings. Pulling from the data feeding the app, he tests for a number of scenarios.
- [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 and take a look here, …
- Setting up for React testing and debugging
- Testing with Jest
- Snapshot testing
- Debugging with Chrome and Chrome extensions
- Optimizing React code with ESLINT
- Type checking