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 ...
Get Learning Single-page Web Application Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.