...

/

Running Tests Automatically and Code Coverage

Running Tests Automatically and Code Coverage

In this lesson, we will be writing tests while getting introduced to different features of Jest.

Running Jest tests automatically

Jumping to the console every time you want to run some tests is a chore. Happily, Jest has a “watch mode” where it automatically re-runs all tests when it detects any change to a test file or a source file dependent on a test.

To start Jest in watch mode, run it with the --watchAll flag:

$ npx jest --watchAll

Now you should see the same failure result as before. Try saving either ...

Access this course and 1400+ top-rated courses and projects.