An easy way to hook process.exit().
$ npm install --save hook-exit
const exit = require('hook-exit');
exit.hook(function() { // exit is disable
console.log('I do not want to exit !');
})
process.exit();
exit.unhook(); // exit is enable
process.exit();
You just have to clone the repo and run
$ npm test
$ npm run coverage
MIT ยฉ Lรฉo Lozach