jest listen EADDRINUSE: address already in use :::5000 jest 1

jest listen EADDRINUSE: address already in use :::5000 jest

"scripts": {
  "test": "jest --forceExit --detectOpenHandles  --watchAll --maxWorkers=1"
},

Here is what the above code is Doing:
1. We’re using the –forceExit flag to make sure Jest exits after all tests have completed running.
2. We’re using the –detectOpenHandles flag to make sure Jest exits if there are any open handles.
3. We’re using the –watchAll flag to make sure Jest watches for any changes in our project.
4. We’re using the –maxWorkers=1 flag to make sure Jest runs tests in a single process.

Similar Posts