Skip to content

Instantly share code, notes, and snippets.

@andrewk
Created January 6, 2015 01:03
Show Gist options
  • Save andrewk/b175483507d1c2307b25 to your computer and use it in GitHub Desktop.
Save andrewk/b175483507d1c2307b25 to your computer and use it in GitHub Desktop.
karma-webpack 1.4 bug
// Karma configuration
module.exports = function (config) {
'use strict';
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
preprocessors: {
'tests/**/*.js': ['webpack'],
'js/**/*.js': ['webpack'],
'components/webpack-jasmine-flight/lib/jasmine-flight.js': ['webpack']
},
frameworks: ['jasmine', 'webpack'],
plugins: [
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-webpack',
'karma-jasmine'
],
// list of files / patterns to load in the browser
files: [
'components/jquery/dist/jquery.js',
'components/es5-shim/es5-shim.js',
'components/es5-shim/es5-sham.js',
'components/jasmine-jquery/lib/jasmine-jquery.js',
'components/jasmine-ajax/lib/mock-ajax.js',
'components/webpack-jasmine-flight/lib/jasmine-flight.js',
'components/pusher/dist/pusher.min.js',
'tests/spec/component_data/deliverable-file.spec.js',
'tests/fixtures/**/*.html',
'tests/run.js'
],
// list of files to exclude
exclude: [
'components/**/specs/**/*',
'components/**/tests/**/*'
],
// test results reporter to use
reporters: ['dots'],
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
browsers: [
'Chrome'
],
webpack: {
resolve: require('./webpack.resolve.js'),
module: require('./webpack.module.js'),
externals: {
'jquery' : '$',
'pusher' : 'Pusher',
},
},
webpackServer: {
progress: false,
stats: true,
debug: true,
quiet: false
},
captureTimeout: 5000,
singleRun: false,
reportSlowerThan: 500,
color: true
});
};
module.exports = {
loaders: [
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.dot$/, loader: 'dot-loader' },
{ test: /pusher/, loader: 'imports?this=>window' }
],
};
module.exports = {
root: __dirname,
alias: {
'jquery': 'jquery/dist/jquery.js',
'moment': 'momentjs/moment.js',
'pusher' : 'pusher/dist/pusher.js',
'fineuploader': 'fineuploader/dist/s3.jquery.fineuploader',
'jasmine-flight': 'jasmine-flight/lib/jasmine-flight.js',
},
modulesDirectories: ['js', 'components', '../node_modules'],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment