WHITECOLOR WHITECOLOR - 9 months ago 32
Javascript Question

JS unit testing: run tests on file changes (like nodemon)

I have two question on JS unit testing:

1) Is there some tool that allows to automaticaly run javascript unit tests when certain files are changed (like for example nodemon restarts node.js on js changes).

2) Is this strategy appropriate (efficient) way to run unit tests?

Thanks,
Alex

Answer Source

Check out grunt build system and the watch task. You can setup grunt to watch for file changes and then run any tasks you want (test, lint, compile, etc...).

https://github.com/cowboy/grunt

Some of the ideas are covered in this tutorial. http://javascriptplayground.com/blog/2012/04/grunt-js-command-line-tutorial