I've been experimenting with a new tool that was released open source recently called JsTestDriver
Here are some features it provides that I thought were nice:
- You run your tests from a java jar on the command line. It's fast and easy.
- Connecting multiple browsers is very straight forward. You just open a magic URL like http://127.0.0.1:4224/capture/ and the browser becomes a worker to your command line test runner. This makes farming out your browsers to multiple servers on other operating systems very easy.
- Tracebacks, whee! Errors and command line output is decent.
- jquery 1.3.2 is provided. You have to be careful to not include your own version though since reloading jquery can cause
$(document).ready(fn)to stop working and probably other cache-related errors.
- The DOM is actually reset before each test which is convenient. You can add elements in your setUp() if you need to like
$("body").add("div").attr("id","foo"). See Manipulating The DOM for more info.
- You can use
assertExpects(n)to help make sure that assertions in callbacks are actually made. I was never a huge fan of counting asserts in tests but this works pretty well as a sanity measure.