views:

55

answers:

1

Yes, I am aware of QUnit, but with the jQuery Paradigm all about getting things done faster with less code, and is this some how opposed to a TDD Paradigm? Or does it complement it somehow?

A: 

JQuery itself has great code coverage and the core dev team uses tools like FireUnit and QUnit. As you extend the library writing your own plugins and methods TDD is even MORE critical. How much time do you spend cross-browser testing and verifying each and every change you make? By creating Unit Tests you can write code in confidence and simply run your test suite and get instant results instead of having to fire up all your browsers and test your changes. By running a test suite every view minutes you at most only lose a few minutes of time if something fails versus losing hours or even days if something breaks. Furthermore, if you have your testing harness set up in a CI build using WatiN or something similar you don't even need to launch browsers it's completely automated. So you are correct, writing tests does take time but it's a "pay now or pay later" scenario, and it's a much cheaper investment to "pay now".

TALLBOY