// Karma configuration
// Generated on Fri Jul 03 2015 10:56:54 GMT-0300 (BRT)
var webpack = require('webpack');

module.exports = function(config) {
  config.set({
    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'sinon', 'sinon-chai'],

    // list of files / patterns to load in the browser
    files: [
      './app/scripts/tests/globals.js',
      'webpack.test.config.js'
    ],

    webpack: {
      devtool: 'inline-source-map',

      resolve: {
        extensions: [ '', '.js', '.jsx', '.json' ]
      },

      module: {
        loaders: [
          {
            test: /\.jsx?$/,
            exclude: /node_modules/,
            loader: 'babel-loader?optional=runtime'
          },
          { test: /\.json$/, loader: 'json' }
        ]
      },

      externals: {
        'react/addons': true,
        'react/lib/ExecutionEnvironment': true,
        'react/lib/ReactContext': 'window'
      },

      plugins: [
        new webpack.DefinePlugin({
          'process.env': {
            'API_URL': '"http://localhost:3000"',
            'NODE_ENV': '"test"'
          }
        }),
        new webpack.DefinePlugin({
          __CLIENT__: true,
          __SERVER__: false,
          __DEVELOPMENT__: true,
          __DEVTOOLS__: false  // <-------- DISABLE redux-devtools HERE
        })
      ]
    },

    webpackServer: {
      noInfo: true
    },

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
      'webpack.test.config.js': [ 'webpack', 'sourcemap' ]
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],

    // 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
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Firefox'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
  })
}

@@ -105,16 +105,210 @@
 bpack');
+%0Avar WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin');%0Avar webpackIsomorphicToolsPlugin = new WebpackIsomorphicToolsPlugin(require('./webpack/webpack-isomorphic-tools'))
 %0A%0Amodule
@@ -827,28 +827,16 @@
        %7B
-%0A           
  test: /
@@ -844,28 +844,16 @@
 .jsx?$/,
-%0A           
  exclude
@@ -869,28 +869,16 @@
 odules/,
-%0A           
  loader:
@@ -909,16 +909,19 @@
 runtime'
+ %7D,
 %0A       
@@ -923,29 +923,16 @@
         
-%7D,%0A          
 %7B test: 
@@ -955,16 +955,129 @@
 r: 'json
+' %7D,%0A          %7B test: webpackIsomorphicToolsPlugin.regular_expression('images'), loader: 'url-loader?limit=10240
 ' %7D%0A    

Fix image import when run tests.