It turns out that I’ve gotten completely side tracked…or maybe not side tracked per se, but at least not completely focused on the client side of the Application. The past couple of weeks I’ve been engulfed in Node. Trying to figure out what it is, what I can do with it and obviously how I can test drive it. I found nodeunit which seemed to be a good testing framework candidate.
Running nodeunit tests from the command line is trivial:
This is all fine and dandy but…I’ve gotten used to doing all of this from within my IDE. I run IntelliJ, for better or worse, and I want to be able to run the tests as well as the debugger from that environment.
I spent way too much time on this, when in fact it turned out to be really simple. Sometimes I wish I were smarter. There is an IntelliJ plugin for Node which enables you to create Run/Debug Configurations for NodeJS sources so I installed that. When I finally(!) examined the nodeunit executable, it turned out to be a one-liner shell script running node with nodeunit as it’s first argument. It’s really just a short cut. I would have saved quite some time if I had figured that out sooner.
This makes the Run Configuration trivial and actually running the test equally trivial.
There isn’t more to it than that.