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 a different ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.