2015-11-19 04:01:05 +08:00
|
|
|
var assign = require('object-assign')
|
|
|
|
var base = require('./karma.base.config.js')
|
|
|
|
|
|
|
|
module.exports = function (config) {
|
|
|
|
var options = assign(base, {
|
|
|
|
browsers: ['PhantomJS'],
|
|
|
|
reporters: ['progress', 'coverage'],
|
|
|
|
coverageReporter: {
|
|
|
|
reporters: [
|
|
|
|
{ type: 'lcov', dir: '../coverage', subdir: '.' },
|
|
|
|
{ type: 'text-summary', dir: '../coverage', subdir: '.' }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
// add coverage post loader
|
|
|
|
options.webpack.module.postLoaders = [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
2016-02-29 10:23:03 +08:00
|
|
|
exclude: /test|node_modules|lib\//,
|
2015-11-19 04:01:05 +08:00
|
|
|
loader: 'istanbul-instrumenter'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
config.set(options)
|
|
|
|
}
|