December 2016
Intermediate to advanced
841 pages
17h
English
Earlier in in this chapter, when we configured Karma, we added some settings to generate test coverage reports. Let's take a look at the karma.conf.js file to identify test coverage-related configuration:
module.exports = function (config) {
'use strict';
config.set({
basePath: '',
frameworks: ['mocha', 'chai', 'sinon'],
browsers: ['PhantomJS'],
reporters: ['progress', 'coverage'],
coverageReporter: {
type : 'lcov',
dir : __dirname + '/coverage/'
},
plugins : [
'karma-coverage',
'karma-mocha',
'karma-chai',
'karma-sinon',
'karma-phantomjs-launcher'
],
preprocessors: {
'**/bundled/test/bdd.test.js' : 'coverage'
}, files : [ { pattern: "/bundled/test/bdd.test.js", included: true }, { pattern: "/node_modules/jquery/dist/jquery.min.js", ...Read now
Unlock full access