One would require to install NodeJS ( http://nodejs.org/ ) which would then be needed to install Karma, the tool to run the Angular tests.

Download & Install Karma

Once NodeJS is downloaded and installed, one can then install Karma based on the instructions on this page ( https://www.npmjs.org/package/ karma ). After installation, I went to D:\ and executed the command, npm install karma. This installed Karma and placed it inside “D:

ode_modules”.

Following are commands one would want to execute at D:\ to get the installation of Karma and appropriate plugins (Jasmine) done.

npm install karma –save-dev

npm install karma-jasmine karma-chrome-launcher –save-dev

npm install -g karma-cli

karma” command from anywhere and it will always run the local version. Check whether all is done by executing the command, “karma”. Above instructions can also be read on Once above is done, you can run Karma simply by executing “” command from anywhere and it will always run the local version. Check whether all is done by executing the command, “karma”. Above instructions can also be read on http://karma-runner.github.io/ 0.12/intro/installation.html page.

Configure Karma The next step is to create a configuration file for running your scripts. Following is configuration that you could copy and paste in a file and name it as “my.conf.js”. Save the file in “D:\”. module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: 'D:\jstest', frameworks: ['jasmine'], files: [ 'angular/angular.min.js', 'angular/angular-route.js', 'angular/angular-mocks.js', 'app/*.js', 'test/*.js' ], exclude: [ ], preprocessors: { }, reporters: ['progress'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: false }); };

karma init my.conf.js and follow the instructions given on the this page ( You could also create this file using the command,and follow the instructions given on the this page ( http://karma-runner.github. io/0.12/intro/configuration. html

In above configuration, following should be noted:

jstest folder is created

jstest/app folder is created to contain application JS files

jstest/test folder is created to contain tests files

jstest/angular folder is created to consists of AngularJS core files (angular.min.js, angular-route.js, angular-mocks.js).