Testable JavaScript
As with most things, getting started is the hardest part. This is especially true of testing in general and an unfortunately reality with JavaScript testing in particular. Beyond the myriad of choices available to the JavaScript community for testing there is the persistent problem of running the tests automatically in a browser (or several browsers) during the normal build and release process.This tutorial will finally give you the chance to get started! Bring your own JavaScript and we will start the test process together - from writing unit tests, to integration tests, all the way to running them manually and most importantly run them automatically as part of an automated process. Along the way we will investigate ideas for refactoring your code to make it more testable and give quick overviews about testable patterns and how they apply to your JavaScript.We will use the Jasmine as the unit test framework, Karma (nee Testacular) for automation, and Istanbul for code coverage as we construct a complete JavaScript testing solution. We will also touch upon WebDriver and how it fits into client-side JavaScript integration testing. By the end of the tutorial you will have a solid foundation upon which to build out a complete suite of automated tests - along with canonical examples of written tests to use as a template for writing the remainder of your tests.