Last active
October 10, 2015 21:00
-
-
Save KidkArolis/0e9708210cc6f2a028e3 to your computer and use it in GitHub Desktop.
An example of karma with karma-webpack
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
var webpackConfig = require('./webpack.config') | |
module.exports = function (config) { | |
// prep your webpack config for karma | |
delete webpackConfig.entry | |
webpackConfig.devtool = 'cheap-inline-source-map' | |
config.set({ | |
// standard karma things | |
basePath: '.', | |
frameworks: ['mocha', 'sinon'], | |
reporters: ['progress'], | |
autoWatch: true, | |
browsers: ['Chrome'], | |
logLevel: config.LOG_INFO, | |
// webpack | |
files: [ | |
'testMain.js' | |
], | |
preprocessors: { | |
'testMain.js': ['webpack', 'sourcemap'] | |
}, | |
webpack: webpackConfig, | |
webpackServer: { | |
noInfo: false, | |
progress: true | |
} | |
}) | |
} |
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
let testsContext = require.context('./tests', true, /Test$/) | |
testsContext.keys().forEach(testsContext) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment