Skip to content

Instantly share code, notes, and snippets.

@cristoferdomingues
Forked from sagalbot/karma.conf.js
Created March 1, 2018 18:55
Show Gist options
  • Save cristoferdomingues/914b7eec4d28d4115581e63db7ee1941 to your computer and use it in GitHub Desktop.
Save cristoferdomingues/914b7eec4d28d4115581e63db7ee1941 to your computer and use it in GitHub Desktop.
Karma Config for Webpack/Vue/Jasmine
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
frameworks: ['jasmine'],
files: ['test/**/*.js'],
reporters: ['spec'],
preprocessors: {
'test/*.js': ['webpack']
},
singleRun: true,
webpack: {
// karma watches the test entry points
// (you don't need to specify the entry option)
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.vue$/,
loader: 'vue'
}
]
}
},
webpackMiddleware: {
noInfo: true
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment