I\'d like to run my PHPUnit tests (or at least a subset of them) whenever a file changes on disk. Very similar to what you can do with \"grunt watch\". I have a project in which
You can use node watch
which is quite sweet:
Run npm init
to set up a package (takes a minute), then
npm install --save-dev watch
Then edit your package.json
file to include these two entries:
"scripts": {
"test": "bin/phpunit tests --color",
"test:watch": "watch 'npm run --silent test' ."
},
Then trigger the watching with:
npm run test:watch
(credit due to this interesting article)