Created
November 8, 2016 12:58
-
-
Save fweep/edd7ada15f43d648feb8e1f16d899366 to your computer and use it in GitHub Desktop.
Karma config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var path = require('path'); | |
module.exports = function (config) { | |
config.set({ | |
basePath: '../webpack/test', | |
reporters: ['mocha'], | |
port: 9876, | |
colors: true, | |
logLevel: config.LOG_INFO, | |
autoWatch: true, | |
singleRun: false, | |
concurrency: Infinity, | |
frameworks: ['mocha', 'chai', 'sinon'], | |
browsers: ['PhantomJS'], | |
files: [ | |
{ | |
pattern: '**/*.test.js', | |
watched: true, | |
included: true, | |
served: true | |
}, | |
], | |
preprocessors: { | |
'**/*.test.js': ['webpack'] | |
}, | |
webpack: { | |
resolve: { | |
root: path.join(__dirname, '..', 'webpack'), | |
extensions: ['', '.js', '.jsx'], | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /.jsx?$/, | |
loader: 'babel-loader', | |
exclude: [/node_modules/], | |
query: { | |
presets: ['es2015', 'react'] | |
} | |
}, | |
] | |
}, | |
// These externals are required to make Enzyme work. | |
// https://github.com/airbnb/enzyme/blob/master/docs/guides/webpack.md | |
externals: { | |
'cheerio': 'window', | |
'react/addons': true, | |
'react/lib/ExecutionEnvironment': true, | |
'react/lib/ReactContext': 'window', | |
}, | |
}, | |
webpackMiddleware: { | |
noInfo: true, | |
}, | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment