public
Description: A Simple JavaScript unit test framework
Homepage:
Clone URL: git://github.com/lukebayes/another-jsunit.git
name age message
file MIT-LICENSE Wed Aug 06 00:08:41 -0700 2008 Working on description [lukebayes]
file README.textile Wed Aug 06 17:57:11 -0700 2008 Working on description [lukebayes]
directory src/ Wed Aug 06 00:12:22 -0700 2008 Removed unused test method [lukebayes]
README.textile

Simple JSUnit

This is NOT the official JSUnit project provided by Pivotal Labs.

This project began as an experiment to help me get familiar with JavaScript again and as it turned out, I made some implementation decisions that differ from Pivotal’s JSUnit enough that I decided to share it.

This framework supports testing simple, synchronous features, asynchronous features and even visual components.

Unlike JSUnit, this framework does not simply search a page for methods that begin with ‘test’, but instead expects you to build JavaScript classes that extend the base TestCase. The experience of using this framework should be much more similar to working with JUnit.

The test framework itself is decoupled from any particular JavaScript framework, but I have only created a ResultPrinter for JQuery output. If you’re using a different JS framework, you should check out the jquery-printer.js and jquery-printer.css files for examples of how you might implement what you need.

This framework was developed over a weekend while working on a Rails application. I’m essentially sharing it because I think it may be useful and wanted to see if anyone else agrees.

If you want changes made, fork, change it and send me a pull request. I’m not planning on creating a community around this tool because all of the smart people I know seem to be satisfied with the existing JSUnit framework.

The simple-jsunit-test.js should provide plenty of examples related to testing simple and asynchronous features. You can also test visual elements by using whatever visual framework you have to modify the DOM and verify the results of your modifications.