Skip to content

Commit

Permalink
feat(karma-webpack): unify webpack and Karma colour config (#356)
Browse files Browse the repository at this point in the history
Closes #332
  • Loading branch information
spicalous authored and matthieu-foucault committed Nov 28, 2018
1 parent fca13b9 commit 9559306
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/karma-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function Plugin(
/* config.files */ files,
/* config.frameworks */ frameworks,
/* config.singleRun */ singleRun,
/* config.colors */ colors,
customFileHandlers,
emitter
) {
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe('Plugin', () => {
[],
[],
true,
true,
[],
emitterMock
);
Expand Down

0 comments on commit 9559306

Please sign in to comment.