const path = require('path')
const webpack = require('webpack')

module.exports = function(config) {
  return config.set({
    frameworks: ['mocha', 'chai', 'sinon', 'sinon-chai'],
    reporters: ['mocha', 'coverage-istanbul'],
    preprocessors: {
      '**/*.coffee': ['webpack', 'sourcemap']
    },
    webpack: {
      devtool: 'inline-source-map',
      resolve: {
        alias: {
          '@': path.resolve(__dirname, 'src')
        },
        extensions: ['.coffee', '.js', '.json']
      },
      module: {
        rules: [
          {
            test: /\.coffee$/,
            use: {
              loader: 'coffee-loader',
              options: {
                sourceMap: true
              }
            }
          }, {
            test: /src\/.+\.coffee$/,
            exclude: /(node_modules|test\/.+\.coffee$|src\/(app|buttons)\.coffee$)/,
            loader: 'istanbul-instrumenter-loader',
            enforce: 'post',
            options: {
              esModules: true
            }
          }
        ]
      },
      plugins: [
        new webpack.SourceMapDevToolPlugin({
          filename: null,
          test: /\.(coffee|js)($|\?)/i
        })
      ]
    },
    webpackMiddleware: {
      noInfo: true
    },
    files: [
      'test/unit/**/*.coffee', {
        pattern: 'test/fixtures/**/*',
        included: false,
        served: true
      }, {
        pattern: 'buttons.js',
        included: false,
        served: true
      }
    ],
    browsers: ['ChromeHeadless', 'Firefox', 'Safari']
  })
}

@@ -790,17 +790,16 @@
 clude: /
-(
 node_mod
@@ -806,55 +806,8 @@
 ules
-%7Ctest%5C/.+%5C.coffee$%7Csrc%5C/(app%7Cbuttons)%5C.coffee$)
 /,%0A 

Update istanbuljs config