Skip to content

Instantly share code, notes, and snippets.

Created March 12, 2015 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/fb66622fa8284c76e6d9 to your computer and use it in GitHub Desktop.
Save anonymous/fb66622fa8284c76e6d9 to your computer and use it in GitHub Desktop.
// Karma configuration
var webpack = require("webpack");
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
client: {
mocha: {
reporter: 'html', // change Karma's debug.html to the mocha web reporter
}
},
// frameworks to use
frameworks: ['mocha'],
// list of files / patterns to load in the browser
files: [
'test/index.js'
],
// list of preprocessors
preprocessors: {
'test/*': ['webpack']
},
webpack: {
resolve: {
extensions: ["", ".js"]
},
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
]
}
},
webpackMiddleware: {
noInfo: true,
stats: {
colors: true
}
},
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['spec'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera (has to be installed with `npm install karma-opera-launcher`)
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
// - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
browsers: ['ChromeCanary'],
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
// List plugins explicitly, since autoloading karma-webpack
// won't work here
plugins: [
require("karma-mocha"),
require("karma-spec-reporter"),
require("karma-chrome-launcher"),
require("karma-webpack")
]
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment