If you’re used to unit testing ( using JUnit in java, Test::Unit in Rails, etc… ), you might like to have a look at http://www.jsunit.net/
“It is essentially a port of JUnit to JavaScript. Also included is a platform for automating the execution of tests on multiple browsers and mutiple machines running different OSs.”