I'm using Mocha with npm, and doing an "npm test" to start up mocha. It has the --watch enabled in the mocha.opts, but for some reason it's not accurately watching. When I make a change to my test file, and then save it, whether I put in a faulty test or an ok test, I get the same thing: 0 passing (in green), whereas, when I first run mocha, I get 2 passing.
Is there something I am missing?
Thanks!
You need to ensure that npm passes the CLI opts through to mocha using:
npm test -- --watch
This will pass the watch flag when npm runs mocha.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With