Getting a base project is important to get quickly started with this course. In this video, Emmanuel Henri presents how to get it set up and where to find it.
- [Instructor] If you took my course from React to React Native, the project we'll use in this course to test and debug will look familiar as it's the same app. If you don't have access to the exercise files and then take the other course, no worries. You can pretty much take any project you're working on and apply the same concepts we'll be exploring here. If you do have access to the exercise files, you'll need to do the following steps in order to get this project up and running. So I am on my desktop and I'm going to create a brand new folder right here, so right click and then create a folder. You can do the same on Mac and then call this testing. And then I'm going to go into the exercise files, and then click on resources and open that folder here as well. And basically copy everything that we have in the resources folder. So copy that. So Control + C on windows, Command + C on Mac, and then paste it into this folder. Once you have this, all you have to do is open this in your favorite editor. In my case, I'm working with Visuals Studio Code. So I'm going to right click and open with Code. And if you're on a Mac, you can simply drag and drop that folder inside of Visual Studio Code. Once you're inside of Visual Studio Code, you can go ahead and open up a terminal. So you can click on Terminal and then New Terminal, and then make sure that you are in the root folder of that project. We're going to do npm install, or I, shortcut for install. Okay. So when you have all the dependencies installed, let's explore a little bit what this project is. So I'm going to minimize this a little bit and then let's take a look at the source folder. So the source folder is where you have all the files. So you have the regular index, which is a React application, and then you have the index.CSS. So in the data folder, you're going to have a JSON file, which will have all the data that we're going to need to run this application. And we're going to have a static file as opposed to persist with a server or database. And then you have the components, and inside of the components, you have listings, a grid and a Single. So basically inside of the App.jS file, we run a grid of single items or single components, which we're going to see in a few seconds. I'm going to run the application and you'll see what I'm talking about. And this is pretty much standard React code that we're going to use to test and debug. So if we do npm start, this is the application that we are going to test and debug. So for your information, if you didn't take the course that I just referenced, this is a React application built from the ground up with Create React app CLI command. The data is a static JSON file created in the data folder as I explore earlier. Okay. So now we have our application properly set up and ready to go.
- 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