Nodejs, automatically run the test when changing files

Is there a way to automatically run tests when a file changes in an application? In the rails there is a gem called a guard. How can one achieve the same in nodejs?

+5
source share
3 answers

try it

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 use it to autoplay phpunit. Replace phpunit with the command to run the tests, replace sleep 5with sleep 1if you want to check every second (depending on the size of your files)

0
source
+6

Jasmine

    jasmine-node <dir> --autotest
+1
source

All Articles