// Karma configuration // Generated on Wed Oct 05 2016 15:34:05 GMT-0700 (PDT) var webpack = require('webpack') var path = require('path') var BROWSERS = (process.env.TRAVIS) ? ['Chrome_travis_ci', 'Firefox'] : ['Chrome', 'Firefox', 'Safari']; 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', 'sinon', 'chai'], // list of files / patterns to load in the browser files: [ 'test/index.js' ], // list of files to exclude exclude: [ 'node_modules/' ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { 'test/index.js': ['webpack', 'sourcemap'] }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['dots', 'coverage'], webpack: { devtool: 'inline-source-map', module: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['airbnb'] } }, { test: /\.js?$/, include: path.resolve(__dirname, 'src'), loader: 'isparta' } ] }, plugins: [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('test') }) ], resolve: { extensions: ['', '.jsx', '.js'] }, externals: { 'cheerio': 'window', 'react/addons': true, 'react/lib/ExecutionEnvironment': true, 'react/lib/ReactContext': true } }, coverageReporter: { reporters: [ { type: 'text-summary' }, { type: 'html', dir: 'coverage/' }, { type: 'lcov' } ] }, webpackServer: { noInfo: true }, // 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: false, customLaunchers: { Chrome_travis_ci: { base: 'Chrome', flags: ['--no-sandbox'] } }, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: BROWSERS, // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: true, // Concurrency level // how many browser should be started simultaneous concurrency: Infinity }) }