Generating code coverage using karma and istanbul
In the previous recipe, we looked at how to configure code coverage tools and associated plugins for karma. In this recipe, you will learn how to generate code coverage reports using karma and istanbul.
Getting ready
Let's configure istanbul, karma, and associated plugins for karma. For more details, refer to the previous recipe, Configuring Code Coverage tools.
You will learn how to generate code coverage reports with the help of the recipe explained in Chapter 2, Jasmine with TDD and BDD Processes. For more information, refer to the Designing the Jasmine test for existing code using TDD and BDD recipe in Chapter 2, Jasmine with TDD and BDD Processes.
How to do it...
You need to perform the following steps to generate code coverage report using istanbul and karma:
First, create a
myKarma.conf.js
configuration file for karma in your local project's directory using the following code:module.exports = function(config) { config.set({ basePath...