Last active
August 29, 2015 14:07
-
-
Save andrewk/6a7a8828d29a3711ff0c to your computer and use it in GitHub Desktop.
Webpack + Jasmine 2 + Flight + Karma (https://github.com/andrewk/webpack-jasmine-flight)
This file contains hidden or 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
module.exports = function (config) { | |
'use strict'; | |
config.set({ | |
basePath: '', | |
preprocessors: { | |
'assets/tests/**/*.js': ['webpack'], // our specs | |
'assets/js/**/*.js': ['webpack'], // our components | |
'assets/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: [ | |
'assets/components/jquery/dist/jquery.js', | |
'assets/components/es5-shim/es5-shim.js', // for phantomjs ES5 compat | |
'assets/components/es5-shim/es5-sham.js', | |
'assets/components/jasmine-jquery/lib/jasmine-jquery.js', | |
'assets/components/jasmine-ajax/lib/mock-ajax.js', | |
'assets/components/webpack-jasmine-flight/lib/jasmine-flight.js', | |
'assets/tests/spec/**/*.spec.js', | |
'assets/tests/fixtures/**/*.html', | |
'assets/tests/run.js' | |
], | |
exclude: [ | |
'assets/components/**/specs/**/*', | |
'assets/components/**/tests/**/*' | |
], | |
reporters: ['dots'], | |
autoWatch: true, | |
browsers: [ | |
'Chrome' | |
], | |
webpack: { | |
resolve: require('./webpack.resolve.js') // webpack aliases | |
}, | |
webpackServer: { | |
progress: false, | |
stats: false, | |
debug: false, | |
quiet: true | |
}, | |
captureTimeout: 5000, | |
singleRun: false, | |
reportSlowerThan: 500, | |
color: true | |
}); | |
}; |
This file contains hidden or 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
// separate file so we can refer to it from webpack.config.js and karma.conf.js | |
module.exports = { | |
root: __dirname, | |
alias: { | |
'jasmine-flight': 'assets/components/webpack-jasmine-flight/lib/jasmine-flight.js', // i don't remember if I truly needed this... | |
}, | |
modulesDirectories: ['assets/js', 'assets/components'], // assets/components is our bower_components dir | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment