Last Updated: February 25, 2016
·
378
· saulshanabrook

Run Tests on Directory Save

Want to run your tests on every file save?

brew install wait_on

Then use wait_on to wait until a git tracked file is changed.

git ls-files  --modified --other --deleted --cached --exclude-standard

Then wrap the whole thing in an infinate loop, with your testing command before.

fish-shell

while true; <testing command>; wait_on -h (git ls-files  --modified --other --deleted --cached --exclude-standard); end

bash

while true; do  wait_on -h $(git ls-files  --modified --other --deleted --cached --exclude-standard); <testing command>; done