Skip to content

Commit

Permalink
fixing for empty test coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
mircobe87 committed Aug 12, 2015
1 parent cd6d6fd commit 3d526cd
Showing 1 changed file with 53 additions and 55 deletions.
108 changes: 53 additions & 55 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,61 @@
module.exports = function karmaConfig(config) {
var postLoaders = [];
// postloader compiles the jsx
// so is needed only for coverage test, not in continuostest
// assume singleRun = false means you are debugging
if (config.singleRun) {
postLoaders.push({
test: /\.jsx$/,
exclude: /(__tests__|node_modules|legacy)\//,
loader: 'istanbul-instrumenter'
});
}
config.set({

browsers: [ 'Chrome' ],
browsers: [ 'Chrome' ],

singleRun: true,
singleRun: true,

frameworks: [ 'mocha' ],
frameworks: [ 'mocha' ],

files: [
'tests.webpack.js'
],

preprocessors: {
'tests.webpack.js': [ 'webpack', 'sourcemap' ]
},

reporters: [ 'dots', 'coverage', 'coveralls' ],

junitReporter: {
outputDir: './web/target/karma-tests-results',
suite: ''
},

coverageReporter: {
dir: './coverage/',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'cobertura', subdir: '.', file: 'cobertura.txt' },
{ type: 'lcovonly', subdir: '.' }
]
},

webpack: {
devtool: 'inline-source-map',
module: {
loaders: [
{ test: /\.jsx$/, loader: 'babel-loader' }
files: [
'tests.webpack.js'
],
postLoaders: postLoaders
},
resolve: {
extensions: ['', '.js', '.json', '.jsx']
}
},

webpackServer: {
noInfo: true
}

});

preprocessors: {
'tests.webpack.js': [ 'webpack', 'sourcemap' ]
},

reporters: [ 'dots', 'coverage', 'coveralls' ],

junitReporter: {
outputDir: './web/target/karma-tests-results',
suite: ''
},

coverageReporter: {
dir: './coverage/',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'cobertura', subdir: '.', file: 'cobertura.txt' },
{ type: 'lcovonly', subdir: '.' }
],
instrumenterOptions: {
istanbul: { noCompact: true }
}
},

webpack: {
devtool: 'inline-source-map',
module: {
loaders: [
{ test: /\.jsx$/, loader: 'babel-loader' }
],
postLoaders: [
{
test: /\.jsx$/,
exclude: /(__tests__|node_modules|legacy)\//,
loader: 'istanbul-instrumenter'
}
]
},
resolve: {
extensions: ['', '.js', '.json', '.jsx']
}
},

webpackServer: {
noInfo: true
}

});
};

0 comments on commit 3d526cd

Please sign in to comment.