Skip to content

Commit

Permalink
keep karma conf consistency to webpack test conf
Browse files Browse the repository at this point in the history
  • Loading branch information
haoliang.wu committed Apr 29, 2016
1 parent fa69dec commit 7789ef5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
25 changes: 6 additions & 19 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Karma configuration
// Generated on Mon Jan 18 2016 12:43:59 GMT+0800 (CST)
const path = require('path')
const testConf = require('./webpack.config.test.js')

module.exports = function (config) {
config.set({
Expand Down Expand Up @@ -30,33 +31,19 @@ module.exports = function (config) {
},

webpack: {
devtool: 'inline-source-map',
devtool: testConf.devtool,
entry: './test/index.js',
externals: {
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
},
externals: testConf.externals,
module: {
preLoaders: [{
test: /\.jsx?$/,
include: [
path.resolve(__dirname, 'src')
],
loader: 'isparta-instrumenter'
}],
loaders: [{
test: /\.jsx?$/, loaders: ['babel'],
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'test'),
path.resolve(__dirname, 'node_modules/refetch')
]
},
{test: /\.(css|less)$/, loader: 'style-loader!css-loader?localIdentName=[hash:base64:8]!less-loader'},
{test: /\.(ttf|eot|woff|woff2|otf|svg)/, loader: 'file-loader?name=./font/[name].[ext]'},
{test: /\.json$/, loader: 'file-loader?name=./json/[name].json'},
{test: /\.(png|jpg|jpeg|gif)$/, loader: 'url-loader?limit=10000&name=./images/[name].[ext]'}
]
}].concat(testConf.module.preLoaders),

loaders: testConf.module.loaders
}
},

Expand Down
2 changes: 1 addition & 1 deletion webpack.config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ module.exports = {
}
].concat(devConf.module.loaders.slice(1)),

preLoaders: devConf.module.preLoaders
preLoaders: [devConf.module.preLoaders]
}
}

0 comments on commit 7789ef5

Please sign in to comment.