REQUEST A DEMO

Unit Testing a JavaScript app

Our Dovetail Agent and Dovetail SelfService products are both very JavaScript-heavy applications. And we have quite a suite of automated tests we run as part of our development process.

Barrett Sonntag (one of our developers here at Dovetail) has written a nice post that details Unit Testing a JavaScript app using RequireJS with Mocha, PhantomJS, Chai & SinonJS.

Unit testing is something every developer agrees should be done, but often doesn’t do. Setting it up isn’t hard after reading and evaluating what feels like a 7 course meal of modules that need to come together hand in hand to allow you to write some tests. It is fairly easy after you’ve learned more than you ever wanted to know about unit testing. Not easy at all, so I’m going to distill a stack down here for you. This is just one of many possible combinations, but when you’re just trying to get started the best solution is the one you pick and stick too first.

This mimics much of what we do here at Dovetail when we test our applications, so you’re getting a peek under the hood to some of our development processes and tools.

And if you like this, you might also like his post on writing custom extensions for the Remarkable JavaScript Markdown parser.

Great stuff Barrett! Thanks for sharing!