Search code examples
npmmocha.jsnpm-run

npm test task with mocha keeps on running


I have the following test task in npm:

"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register 'test/**/*.ts'",

When I run npm run test it performs tests but after running all of them the command does not finish.

Is there a way to alter the command in a way it will finish after all the tests?


Solution

  • I ended up adding --exit flag for mocha