diff --git a/packages/kyt-core/utils/__tests__/webpackCompiler.test.js b/packages/kyt-core/utils/__tests__/webpackCompiler.test.js index de0ef0e7a..74b46e8b9 100644 --- a/packages/kyt-core/utils/__tests__/webpackCompiler.test.js +++ b/packages/kyt-core/utils/__tests__/webpackCompiler.test.js @@ -34,7 +34,11 @@ describe('webpackCompiler', () => { }); it('then displays any warnings', () => { - pluginDone({ hasErrors: () => false, hasWarnings: () => true }); + pluginDone({ + hasErrors: () => false, + hasWarnings: () => true, + toJson: () => ({ warnings: [] }), + }); expect(logger.warn).toBeCalled(); }); diff --git a/packages/kyt-core/utils/webpackCompiler.js b/packages/kyt-core/utils/webpackCompiler.js index 9b10e827c..82baf1cfe 100644 --- a/packages/kyt-core/utils/webpackCompiler.js +++ b/packages/kyt-core/utils/webpackCompiler.js @@ -20,7 +20,7 @@ module.exports = (webpackConfig, cb) => { logger.error(`${type} build failed\n`, stats.toString()); logger.info('See webpack error above'); } else if (stats.hasWarnings()) { - logger.warn(`${type} build warnings`, stats.toString()); + logger.warn(`${type} build warnings`, stats.toJson().warnings.join('\n')); } else { logger.task(`${type} build successful`); }