I am a big jsUnit fan. I can't imagine what JavaScript development would be like if that tool did not exist. We all know that code without proper unit test coverage is legacy code. It is a time bomb waiting to go off in the hands of the developer that touches it next.
Over time I have noticed a pattern in my jsUnit usage. I usually wear one of two testing hats when writing tests:
picker.GetDate({ value: "12/25/2004" }); //Last Christmas I gave you my heart…
Try not to wear both hats at the same time! You risk high coupling to the underlying DOM that will make browser compatibility hard to test. The code will be hard to change too – what if you want to change that hand-crafted list of links to a more accessible and standards-compliant ordered list?
Stefan Rahnev (@StDiR) is Product Manager for Telerik Kendo UI living in Sofia, Bulgaria. He has been working for the company since 2005, when he started out as a regular support officer. His next steps at Telerik took him through the positions of Technical Support Director, co-team leader in one of the ASP.NET AJAX teams and unit manager for UI for ASP.NET AJAX and Kendo UI. Stefan’s main interests are web development, agile processes planning and management, client services and psychology.