Posted by Lena Mon, 04 Jan 2010 12:07:00 GMT

Selecting a unit test framework for a JavaScript-only application - not a task with an obvious answer! Coming from the Rails world, where most people work with either TestUnit or RSpec, I was a bit lost when I started researching. This table on wikipedia was quite helpful for a first overview. But: JsUnit, JSTest, jsUnitTest, jsUnity - these are actually different frameworks, and there's even many more ...

I narrowed the selection down to those being currently developed, or are in use in "big" projects. JsUnit seems to be one of the major players, but I found almost no documentation, and the code base hasn't changed a lot in the last years. That's not a negative thing in itself, but having an active community around is a good thing. QUnit is used for testing JQuery, it looked like you could work with it as well, but its syntax and setup didn't make me go "wow" exactly. Same goes for JQUnit, about which I had read good stuff in several blog posts. It's also what Sammy.js is tested with.

I like RSpec, so when I had my first look at ScrewUnit, I was delighted to find there's BDD syntax for JavaScript too ...

2 comments |