From a86075f3b2481250984bfd96e987ca9348957d5d Mon Sep 17 00:00:00 2001 From: delambo Date: Fri, 24 Mar 2017 22:08:22 -0400 Subject: [PATCH] fixes warning logging --- packages/kyt-core/utils/__tests__/webpackCompiler.test.js | 6 +++++- packages/kyt-core/utils/webpackCompiler.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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`); }