I am setting up nyc/mocha for my project. I want to pass --exit
option to mocha when running mocha with/without nyc.
Here's my packages.json:
"scripts": {
"start": "node ./app",
"test": "./node_modules/.bin/mocha --exit",
"test-with-coverage": "nyc --reporter=html mocha --reporter mochawesome --exit",
"apidoc": "apidoc -i routes/ -o apidocs/"
}
But this throws invalid option error when I run npm test or npm run test-with-coverage.
How do you pass any options to mocha from npm?
--
in your command (after html mocha) – hereandnow78--
it doesn't work. – Sumit Jainnyc --reporter=html mocha -- --reporter mochawesome
? – Orelsanpls