O'Reilly logo

Mastering AngularJS for .NET Developers by Mohammad Wadood Majid, Golrokh Mirzaei

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit testing using Karma

Karma is an open source JavaScript command-line tool, which is used to spawn a web server to load an application's source code and execute the test. We can configure Karma to run from different browsers. Karma is a command-line tool and will show the results of the application on the command line when the application runs in the browser. Karma is a Node.js application that can be installed through the npm package manager using the following code:

$ npm install --save-dev karma We used the following command to execute the karma $ karma start karma.conf.js We needs to test the following AngularJS's controller var app = angular.module('myApp', []) app.controller('ctrlMain', function($scope) { $scope.name = "Mohammad Majid"; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required