Javascript Software Testing: unit testing, open source, Jasmine, Karma, Casper.js, QUnit, SinonJS, etc.
AngularJS is an open-source JavaScript framework, maintained by Google, that assists with running single-page applications. This article written by Andy Shora discusses best practices to peform unit testing and integration testing with AngularJS.
In an exploration of the best tools to perform unit testing on JavaScript code, Matthew Setter explores how QUnit can perform this task. QUnit is an open source JavaScript unit testing framework that is used by the jQuery, jQuery UI and jQuery Mobile projects and is capable of testing any generic JavaScript code.
Venus.js in an open source software testing tool developed by LinkedIn that allows you to organize and run your entire JS testing system with a single tool using Node.js. Venus eliminates repetitive tasks and friction points and lets you focus on writing tests instead of running them.
Testable JavaScript is a process. Whether starting with a blank slate or an already implemented application (or somewhere in-between) being able to test your JavaScript code simply, cleanly, and effectively is a necessary feature. Code that cannot be tested will be rewritten.
In this blog post, Francois Zaninotto provides an detailed explanation on how to do functional testing for Node.js using the Mocha open source software testing framework. Mocha is a feature-rich JavaScript test framework running on node.js and the browser. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.
Jasmine is a behavior-driven development framework for testing JavaScript code with a clean, obvious syntax so that you can easily write tests. Testem is test runner that makes Javascript unit testing easier. In this blog post, Joe Zimmerman provides a step by step approach to set up a Jasmine unit testing environment with Testem.
Martin Flower defines legacy code as code without tests. You test your server-side code, but if you are working on a site with a fair amount of non-trivial JavaScript (ajax call, extensive callbacks, etc.) you really should be testing your JavaScript as well. All the untested JavaScript code we are writing today is, in effect, legacy code, but we can address this with JavaScript unit testing!