First though, let's install Karma. We are going to install Karma using npm. Karma basically has two components: Karma itself, which uses Node.js, and the Karma Command Line Interface (CLI). We are going to install Karma in our project folder and we can install the CLI globally for easy access from the command line:

npm install karma --save-dev
npm install karma-cli -g

Optionally, you can use Yeoman, but we will not use the defaults for now, so that is pretty useless at this point. However, if you really want to, you can:

npm install generator-karma -g
yo karma
npm install karma-cli -g

Karma is all about configuration. Now that we have the Karma CLI tool installed, we can easily generate a configuration file. Just use karma init ...

Get Continuous Integration, Delivery, and Deployment now with O’Reilly online learning.

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