fix: exclude test files when dist test coverage report

This commit is contained in:
陈嘉涵 2017-08-28 14:55:39 +08:00
parent 561821d03a
commit 17779384ee
2 changed files with 17 additions and 2 deletions

View File

@ -75,7 +75,21 @@ function getWebpackConfig(testFileName) {
]
},
{
test: /\.vue$/,
test: /test\/unit\/components\/.*\.vue$|packages\/swipe\/.*\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
loaders: {
css: ['style-loader', 'css-loader', 'postcss-loader']
}
}
}
]
},
{
test: /packages\/.*\.vue$/,
exclude: /packages\/swipe\/.*\.vue$/,
use: [
{
loader: 'vue-loader',

View File

@ -14,7 +14,8 @@ module.exports = function(config) {
reporters: ['spec', 'coverage'],
files: ['./index.js'],
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
'./index.js': ['webpack', 'sourcemap'],
'test/unit/!(components)/**/*.vue': ['coverage']
},
webpack: getWebpackConfig(getTestFileName()),
webpackMiddleware: {