Skip navigation

Tag Archives: unit testing

So I’m pretty unhappy with the existing unit test frameworks out there for JavaScript. There’s Dojo’s D.O.H., YUI Test ( written by @slicknet ), JSTest, JSUnit, Jquery’s QUnit.

And now there’s Achaean.

Summary of the project:

No assumptions. One file. Easy to use.

There are many JavaScript? unit test frameworks out there. More notably Dojo’s D.O.H., JSUnit, JSTest, YUI Test. If you search Google Code’s project hosting, you’ll find even more. They all assume a lot. They may assume you’re testing in a browser or Rhino. They may assume you’re using a given framework. They may require several files, a custom build, or something else.

This framework will require nothing other than one file. You can test in a browser or on the command line using Rhino, this framework is agnostic on the issue.

How does it work? The result is a native JavaScript? object that is returned to the script running the test. You can do whatever you want with it. It will have a list of errors, test results, in plain text, or html. You can display it in the browser console, on a Rhino Shell, in an HTML document, an XUL Panel , or even an alert window and format it as you want.

Achaean’s flexibility will let you use it as part of a build script to ensure required tests pass before building or packaging for production or staging.

Ease of use.

Simple methods, simple set up. Just download the file, look at the few simple steps involved and start writing your tests within minutes.

Here’s the code. Feedback welcomed.