Defining the script to run tests

In order to run the test code, we will update the run scripts defined in package.json, to add a script for running tests with jest:

  "scripts": {    "test": "jest"  }

In the command line, if we run npm run test, it will prompt Jest to find the test code in the application folders and run the tests.

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.