Here’s a popular list of unit testing frameworks for Javascript: QUnit, JSUnit and YUITest. All of these can be used for test driving your JS code. But let’s take this one step further - to Behaviour Driven Development. With BDD, you get the added advantage of “specing” your tests with a business driven mindset - rather than just thinking about your code. Jasmine is the de-facto standard for BDD in Javascript. Now let’s assume you’ve configured Jasmine correctly and that you’ve written your specs. But how do you run them? Well, that depends on whether you need access to a DOM or not. Assuming that do need access to a DOM, you can either rely on your faithful browser itself or go for a headless Webkit like PhantomJS. We prefer to test in a real environment - and that’s exactly what JSTestDriver allows you to do.