开发者

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜