diff --git a/src/karma-webpack.js b/src/karma-webpack.js index a46148e7..e01bd442 100644 --- a/src/karma-webpack.js +++ b/src/karma-webpack.js @@ -53,6 +53,7 @@ function Plugin( /* config.files */ files, /* config.frameworks */ frameworks, /* config.singleRun */ singleRun, + /* config.colors */ colors, customFileHandlers, emitter ) { @@ -226,6 +227,11 @@ function Plugin( compiler.hooks.invalid.tap(this.plugin, invalid.bind(this)); webpackMiddlewareOptions.publicPath = '/_karma_webpack_/'; + + // Set webpack's color config to value specified in Karma's config for consistency + webpackMiddlewareOptions.stats = webpackMiddlewareOptions.stats || {}; + webpackMiddlewareOptions.stats.colors = colors; + const middleware = new WebpackDevMiddleware( compiler, webpackMiddlewareOptions diff --git a/test/plugin.test.js b/test/plugin.test.js index 156e51e0..b8bc86b0 100644 --- a/test/plugin.test.js +++ b/test/plugin.test.js @@ -19,6 +19,7 @@ describe('Plugin', () => { [], [], true, + true, [], emitterMock );