mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-02 12:07:39 +08:00
34 lines
820 B
JavaScript
34 lines
820 B
JavaScript
var base = require('./karma.base.config.js')
|
|
|
|
module.exports = function (config) {
|
|
var options = Object.assign(base, {
|
|
browsers: ['PhantomJS'],
|
|
reporters: ['mocha', 'coverage'],
|
|
coverageReporter: {
|
|
reporters: [
|
|
{ type: 'lcov', dir: '../coverage', subdir: '.' },
|
|
{ type: 'text-summary', dir: '../coverage', subdir: '.' }
|
|
]
|
|
},
|
|
singleRun: true,
|
|
plugins: base.plugins.concat([
|
|
'karma-coverage',
|
|
'karma-phantomjs-launcher'
|
|
])
|
|
})
|
|
|
|
// add babel-plugin-istanbul for code intrumentation
|
|
options.webpack.module.rules[0].options = {
|
|
plugins: [['istanbul', {
|
|
exclude: [
|
|
'test/',
|
|
'src/compiler/parser/html-parser.js',
|
|
'src/core/instance/proxy.js',
|
|
'src/sfc/deindent.js'
|
|
]
|
|
}]]
|
|
}
|
|
|
|
config.set(options)
|
|
}
|