I am writing my unit tests for NodeJS using Jest.
A part of my code exits using process.exit(1)
, so when trying to test it using Jest, the test terminates when it comes to this line with the error Command failed with exit code 1.
which is the default behaviour of process.exit(1)
.
Can anyone please tell how to work with Jest to handle this scenario and continue with the other tests?