The introduction to QUnit over at netTuts.com spawns an interesting exchange (never resolved) over how to apply unit tests against actions that manipulate the DOM. The following
You can run them in env.js, if you don't want the hassle of creating html page sandboxes for all your tests.