One of my pet projects is open source and tested with JsTestDriver [1], that should be a good starting point for learning more about how to test JavaScript in webapps.
I also like to use Sinon [2] for stubbing and mocking. The author of Sinon is also putting the finishing touches on a book about TDD-ing JavaScript.
EDIT: calendar-logic.js [4] an example of how you can extract and test logic in separate libraries. It's being used on figureoutwhen.com.
One of my pet projects is open source and tested with JsTestDriver [1], that should be a good starting point for learning more about how to test JavaScript in webapps.
I also like to use Sinon [2] for stubbing and mocking. The author of Sinon is also putting the finishing touches on a book about TDD-ing JavaScript.
EDIT: calendar-logic.js [4] an example of how you can extract and test logic in separate libraries. It's being used on figureoutwhen.com.
[1] http://github.com/augustl/figureoutwhen.com [2] http://cjohansen.no/sinon/ [3] http://www.amazon.com/Test-Driven-JavaScript-Development-Dev... [4] http://ditrw.com/calendar-logic-dot-js/