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 numbers. Pulling from the data feeding the app, he tests for a number of scenarios.
- [Instructor] So let's keep going … with now a test for strings. … So we're going to do again some tests in our Grid.test.js … because this is one that actually includes … the data for our courses. … So let's go ahead and do two more tests … that are related to strings. … So what I'm going to do now is actually add a variable. … So let's create a variable that will be dataTest … which equals to data.title … and if you want to know, what we're actually using is this. … So let's go into courses.json, … we're actually using position zero in our array, … so basically this guy here, … and the title is Building an App with ReactJS and MeteorJS. … So if you want to check on the application as well … you can actually go here. … You're going to see that this is the first element … in our application, so element zero in the array. … So the title would be … Building an App with ReactJS and MeteorJS. … So you can see the application actually replicates … what we just saw in their code. … So let's go back to our code …
- 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