nodejs, run test automatically when files change
Is there a way to automatically run tests, when a fi开发者_如何学运维le in the app is changed? In rails there is a gem called guard. How can one achieve the same in nodejs?
Not sure if this would work for tests, but Nodemon (https://github.com/remy/nodemon) looks like what you want.
Install Jasmine and run
jasmine-node <dir> --autotest
Try this
touch /tmp/nt; while [ true ]; do if [
find . -newer /tmp/nt -type f | grep -v app/cache | wc -l
-gt 0 ]; then phpunit; touch /tmp/nt; fi; sleep 5; done
I'm using it to autostart phpunit. Replace phpunit with the command to run tests
replace sleep 5
with sleep 1
if you wish to check every second (depends on the size of your files)
精彩评论