Want to run Node.js tests every time a file changes? Add this to your
alias automocha="supervisor -q -n exit -x mocha -- -b"
And of course, install mocha and supervisor to your global context:
$ npm install -g supervisor mocha
Now just run
automocha to invoke
mocha every time a file changes.
Bonus: add it to your package.json
Don't want to have these on the global context? That's fair, just merge these definitions into your package.json:
"autotest": "./node_modules/.bin/supervisor -q -n exit -x ./node_modules/.bin/mocha -- -b"
Then run it:
$ npm run autotest