From the course: React: Testing and Debugging

Unlock the full course today

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

Test string with matchers

Test string with matchers - React.js Tutorial

From the course: React: Testing and Debugging

Start my 1-month free trial

Test string with matchers

- [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[0].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…

Contents