O'Reilly logo

Learning Single-page Web Application Development by Fernando Monteiro

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

Configuring Karma (unit testing)

Karma is configured with a file called karma.conf.js.

Tip

You can find more information about Karma at http://karma-runner.github.io/0.12/index.html.

The easiest way to create this file is to use the karma-cli tool. This way, you will have the init command available in your terminal. This is a standard procedure used in many tools available for Node.js environments, such as Grunt, Bower, and some others.

Command line interface (CLI) helps us to create files and settings in a simple and fast way using the terminal. As we already have the karma.conf.js file, we don't need to perform the init command.

Open the project folder. Now, let's review the karma.conf.js file to understand it line by line:

'use strict'; /** * Module ...

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