Focus on the Controller

For this exercise, we’ll use Karma, Mocha, Chai, angular-mocks, and of course AngularJS. We’ll build alongside the code created in the previous chapter.

Get the Workspace Ready

Change directory to tdjsa/testangularjs/todo—this is the new workspace for the automated testing using AngularJS. This workspace directory contains all the code examples created in the previous chapter. In addition, the package.json file has been updated to include the dependency angular-mocks.js. The angular.js file has also been downloaded to the public/javascripts directory from the AngularJS download[26] page. Note that it’s imperative for the version of angular-mocks.js to match the version of AngularJS, in case you plan to play with ...

Get Test-Driving JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.