Created
November 30, 2015 10:39
-
-
Save RB-Lab/3bc44ccc6687095962b6 to your computer and use it in GitHub Desktop.
Minimal Karma config for use with React & Babel & Browserify
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
// you need to $ npm i -D babel-preset-es2015 babel-preset-react babel-preset-stage-0 babelify karma karma-browserify karma-chai karma-mocha karma-mocha-reporter karma-phantomjs-launcher phantomjs-polyfill array.from | |
module.exports = function conf(config) { | |
config.set({ | |
frameworks: ['browserify', 'mocha', 'chai'], | |
plugins: [ | |
'karma-browserify', | |
'karma-mocha', | |
'karma-chai', | |
'karma-phantomjs-launcher', | |
'karma-mocha-reporter' | |
], | |
files: [ | |
'./node_modules/phantomjs-polyfill/bind-polyfill.js', | |
'./node_modules/array.from/array-from.js', | |
'src/*.js', | |
'src/__tests__/*-test.js' | |
], | |
preprocessors: { | |
'src/**/*.js': ['browserify'] | |
}, | |
browserify: { | |
configure: function browserify(bundle) { | |
bundle.once('prebundle', function prebundle() { | |
bundle.transform('babelify', {presets: ['es2015', 'react', 'stage-0']}); | |
}); | |
} | |
}, | |
reporters: ['mocha'], | |
port: 9876, | |
colors: true, | |
logLevel: config.LOG_INFO, | |
autoWatch: true, | |
browsers: ['PhantomJS'], | |
singleRun: false, | |
concurrency: Infinity | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for webpack deps would be: