If you are currently using Rhino to run Javascript then PhantomJS makes for an excellent and more functional replacement.
In addition to running library unit tests in a 'real' browser environment it can also be used to test apis and visual components, and then save results as files and screenshots for use with other systems such as Hudson.
I use it extensively for our web app build and test cycle at work (Causata.com) and to save time for anyone interested in rolling their own have made the code available on Github at https://github.com/metafeather/phantomjs-yuitest
In addition to running library unit tests in a 'real' browser environment it can also be used to test apis and visual components, and then save results as files and screenshots for use with other systems such as Hudson.
I use it extensively for our web app build and test cycle at work (Causata.com) and to save time for anyone interested in rolling their own have made the code available on Github at https://github.com/metafeather/phantomjs-yuitest