To watch for file changes and only run tests related to changed files. This requires that your project is a Git repository.

jest --watch

To watch for file changes and run all tests. This does not require that your project be a Git repository.

jest --watchAll

We often add this to our npm scripts

{
  "scripts": {
    "test": "jest",
    "test:watch": "jest --watch"
  }
}

Reference: Jest CLI documentation