Add karma based testing

This commit is contained in:
lukasmartinelli
2016-11-23 14:38:09 +01:00
parent b3d355957d
commit 824821f2c8
5 changed files with 56 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
var webpackConfig = require('./webpack.config.js');
// Karma configuration
module.exports = function(config) {
config.set({
browsers: [ 'Chrome' ], //run in Chrome
frameworks: [ 'mocha' ], //use the mocha test framework
// ... normal karma configuration
files: [
// all files ending in "_test"
{pattern: 'test/*_test.js', watched: false},
{pattern: 'test/**/*_test.js', watched: false}
// each file acts as entry point for the webpack configuration
],
preprocessors: {
// add webpack as preprocessor
'test/*_test.js': ['webpack'],
'test/**/*_test.js': ['webpack']
},
webpack: webpackConfig,
webpackMiddleware: {
// webpack-dev-middleware configuration
// i. e.
stats: 'errors-only'
}
});
};