Skip to content

Instantly share code, notes, and snippets.

@sagalbot
Created April 29, 2016 19:28
Show Gist options
  • Save sagalbot/a23ebf15c68d15842e96df038fbc42ce to your computer and use it in GitHub Desktop.
Save sagalbot/a23ebf15c68d15842e96df038fbc42ce 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