vue2/test/unit/karma.base.config.js

50 lines
904 B
JavaScript
Raw Normal View History

const alias = require('../../scripts/alias')
const webpack = require('webpack')
2016-04-24 08:00:38 +08:00
const webpackConfig = {
2018-10-24 22:41:38 +08:00
mode: 'development',
2016-04-24 08:00:38 +08:00
resolve: {
2016-11-12 09:25:11 +08:00
alias: alias
2016-04-24 08:00:38 +08:00
},
module: {
2017-02-02 01:18:01 +08:00
rules: [
2016-04-24 08:00:38 +08:00
{
test: /\.js$/,
2017-02-02 01:18:01 +08:00
loader: 'babel-loader',
2016-04-24 08:00:38 +08:00
exclude: /node_modules/
}
]
},
plugins: [
new webpack.DefinePlugin({
__WEEX__: false,
2016-04-24 08:00:38 +08:00
'process.env': {
2017-11-24 23:16:07 +08:00
TRANSITION_DURATION: process.env.CI ? 100 : 50,
2017-03-17 12:09:12 +08:00
TRANSITION_BUFFER: 10
2016-04-24 08:00:38 +08:00
}
})
],
devtool: '#inline-source-map'
}
// shared config for all unit tests
module.exports = {
frameworks: ['jasmine'],
files: [
'./index.js'
2016-04-24 08:00:38 +08:00
],
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
2016-04-24 08:00:38 +08:00
},
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
},
plugins: [
'karma-jasmine',
'karma-mocha-reporter',
'karma-sourcemap-loader',
'karma-webpack'
]
2016-04-24 08:00:38 +08:00
}