Unit Testing Your JavaScript

This falls into the category of something I want to remember… so I’m putting it here… Unit Test 101: Are You Testing Your JavaScript?

As Microsoft seems to have been blocked on their XAML everywhere strategy as a cross-platform strategy they seem to be looking now to HTML5 and JavaScript. I was enthusiastic about the use of Silverlight and Windows Presentation Foundation (WPF) as two presentation tiers that could relatively easily share a common logic/data tier. But when Apple banned both Flash and Silverlight from the devices that created some issues. I was hoping that consumers would complain loudly about not having it and that Apple would listen to their customers. Not the case.

So now what… I see continued references to HTML5 and JavaScript as the way to achieve the cross-platform support. But I’ve grown very accustomed to high quality software made possible by a strong unit testing strategy (ideally test driven development or TDD). So this post is a pointer to an excellent article that is at least a start for doing that in a JavaScript world.

I hope Microsoft really pushes the envelope on their testability of JavaScript in their next release of Visual Studio.

Thanks Christian Johansen!


Posted

in

by

Comments

2 responses to “Unit Testing Your JavaScript”

  1. […] I had with JavaScript was the lack of testability. Until a colleague of mine pointed out one of my previous posts I completely forgot about some of the techniques for testing JavaScript. But from what little […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.