Automatically running tests on your back-end Node.js code - 1 minute read

--deprecated: this only works intermittently--

Building something for the front-end and want to run tests on your code automatically?  Use Karma (http://karma-runner.github.io/1.0/intro/configuration.html).  It'll run tests in web browsers when you save your .js files.

But what if you're building for the back end and don't want to run the tests in browsers?  I'm assuming that you already have nodemon installed and don't want to muddle up your Grunt / Gulp / other automation modules.

Use nodemon.

The general syntax is:
   nodemon --watch <folder> --exec <command>

For example:
   nodemon --watch js/ --exec ./node_modules/.bin/jasmine

Comments

Popular posts from this blog

Optional object property access

A short guide to cross-site request forgery attacks

How is an application like a bride's outfit? - 1 minute read