Skip to content

Instantly share code, notes, and snippets.

@marr
Created February 20, 2015 01:40
Show Gist options
  • Save marr/880a91d831b02ed02daa to your computer and use it in GitHub Desktop.
Save marr/880a91d831b02ed02daa to your computer and use it in GitHub Desktop.
// Karma configuration
// Generated on Tue Sep 16 2014 09:05:25 GMT-0700 (PDT)
var webpackConfig = require('./webpack.config');
webpackConfig.watch = true;
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai-sinon', 'sinon'],
// list of files / patterns to load in the browser
files: [
'bind-polyfill.js',
'karma-shims.js',
'test/unit/index.js'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/unit/index.js': ['webpack']
},
webpack: webpackConfig,
webpackServer: {
quiet: true
},
client: {
mocha: {
globals: ['FB']
}
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['junit', 'tap'],
// web server port
port: 9876,
junitReporter: {
outputFile: 'test-results.xml',
suite: ''
},
tapReporter: {
outputFile: './unit.tap'
},
// 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
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome', 'PhantomJS'],
// webpack means that PhantomJS sometimes does not respond in time
browserNoActivityTimeout: 30000,
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment