const webpackConfig = require('../webpack/webpack.test.config');
const path = require('path');

module.exports = (config) => {
	config.set({
		frameworks: ['mocha', 'sinon-chai'],
		reporters: ['coverage', 'mocha'],
		browsers: ['Chrome'],

		autoWatch: false,
		singleRun: true,

		/**
		 * Define the karma file.
		 *
		 * @type {Array}
		 */
		files: [{
			pattern: './test-bundler.js',
			watched: false,
			served: true,
			included: true,
		}],

		// Setup the preprocessors
		preprocessors: {
			['./test-bundler.js']: ['webpack', 'sourcemap'],
		},

		// Load the webpack configuration
		webpack: webpackConfig,

		// Prevent webpack spamming
		webpackMiddleware: {
			noInfo: true,
			stats: 'errors-only',

		},

		// customLaunchers: {
		// 	ChromeTravis: {
		// 		base: 'Chrome',
		// 		flags: ['--no-sandbox'],
		// 	},
		// },

		coverageReporter: {
			dir: path.join(process.cwd(), 'coverage'),
			reporters: [
				{ type: 'lcov', subdir: 'lcov' },
				{ type: 'html', subdir: 'html' },
				{ type: 'text-summary' },
			],
		},
	});
};

@@ -220,16 +220,68 @@
 rowsers:
+ process.env.TRAVIS%0A      ? %5B'ChromeTravis'%5D%0A      :
  %5B'Chrom
@@ -761,25 +761,24 @@
 -only',%0A
-%0A
 %09%09%7D,%0A%0A%09%09
 // custo
@@ -769,19 +769,16 @@
 %09%09%7D,%0A%0A%09%09
-// 
 customLa
@@ -790,19 +790,16 @@
 rs: %7B%0A%09%09
-// 
 %09ChromeT
@@ -809,19 +809,16 @@
 is: %7B%0A%09%09
-// 
 %09%09base: 
@@ -829,19 +829,16 @@
 ome',%0A%09%09
-// 
 %09%09flags:
@@ -862,20 +862,14 @@
 ,%0A%09%09
-// 
 %09%7D,%0A%09%09
-// 
 %7D,%0A%0A

Set up test support for travis.