2016-04-24 08:00:38 +08:00
|
|
|
var base = require('./karma.base.config.js')
|
|
|
|
|
|
|
|
module.exports = function (config) {
|
|
|
|
var options = Object.assign(base, {
|
|
|
|
browsers: ['PhantomJS'],
|
|
|
|
reporters: ['progress', 'coverage'],
|
|
|
|
coverageReporter: {
|
|
|
|
reporters: [
|
|
|
|
{ type: 'lcov', dir: '../coverage', subdir: '.' },
|
|
|
|
{ type: 'text-summary', dir: '../coverage', subdir: '.' }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
singleRun: true
|
|
|
|
})
|
|
|
|
|
2016-05-18 13:16:09 +08:00
|
|
|
// add babel-plugin-coverage for code intrumentation
|
2016-05-16 13:03:32 +08:00
|
|
|
options.webpack.babel = {
|
2016-05-18 13:16:09 +08:00
|
|
|
plugins: [['coverage', {
|
2016-05-16 13:03:32 +08:00
|
|
|
ignore: [
|
|
|
|
'test/',
|
|
|
|
'src/compiler/parser/html-parser.js',
|
|
|
|
'src/core/instance/proxy.js'
|
|
|
|
]
|
|
|
|
}]]
|
|
|
|
}
|
2016-04-24 08:00:38 +08:00
|
|
|
|
|
|
|
config.set(options)
|
|
|
|
}
|