karma coverage does not show any data

Thursday, July 10, 2014

I have included the source files in the files & preprocessors section of my karma conf file. The tests run fine and the junit xml report shows the data. The html coverage just show 100% without any data. I have the similar structure for another project which is working fine but not this one. Not sure if i am missing something. Might be a very minor or silly thing i have missed.


karma.conf.js:



module.exports = function (config) {
config.set({
basePath: '../../',

frameworks: [
'jasmine'
],

// list of files / patterns to load in the browser
files: [
'app/js/**/*.js',
'test/spec/**/*.js'
],

preprocessors: {
'app/js/**/*.js': ['coverage']
},

exclude: [],

reporters: [ 'progress', 'junit', 'coverage' ],

coverageReporter: {
type: 'html',
dir: 'test/reports/unit/coverage'
},

junitReporter: {
outputFile: 'test/reports/unit/junit/junit.xml',
suite: 'unit'
},

port: 9876,

runnerPort: 9100,

colors: true,

logLevel: config.LOG_DEBUG,

autoWatch: false,

browsers: [ 'Chrome' ],

captureTimeout: 60000,

singleRun: true
});
};


my karma conf file is in test -> spec -> conf and source files are in app -> js -> controllers/directives/services


the debug log shows its loading all the files in preprocessors but the report does not show any data "No data to display".







http://ift.tt/1mEiwd2