Some basic commands are available out of the box with Jest to test a React application. In this video, Emmanuel Henri shows you the commands to run them.
- [Instructor] The beauty of starting a React project … with Create React App is that you get … some very useful tools like Jest. … So, in other words, there's no installation needed … as Jest comes pre-installed and ready to go. … It even has an example task, … so let's take a look at it in action. … So if you go inside of the project that we just set up, … and go into the components folder, … you're going to find a file that says app.test.js. … And this is one test that's already inside … of your application when you create … a new application with React. … So this test is basically … telling you that it renders without crashing, … so that means the application's running without crashing. … So if you want to test this, you can stop the application … by doing control C or command C on a Mac. … Here, let me just let me put more … screen estate here, and then all you have to do is … npm run test, … and this is going to run the test command … from your package.json file. … So if you look at the package.json file, …
- 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