From df41397a32e1354d08ccc7c0af3290b784a66179 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Tue, 14 Apr 2020 11:13:58 +0300 Subject: [PATCH] [Gradle, JS] Add cohesion for console method and message type #KT-38286 fixed --- .../tools/kotlin-test-js-runner/tc-log-error-webpack.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/tools/kotlin-test-js-runner/tc-log-error-webpack.js b/libraries/tools/kotlin-test-js-runner/tc-log-error-webpack.js index a7496a69b00..e4ccc084ebe 100644 --- a/libraries/tools/kotlin-test-js-runner/tc-log-error-webpack.js +++ b/libraries/tools/kotlin-test-js-runner/tc-log-error-webpack.js @@ -13,18 +13,21 @@ class TeamCityErrorPlugin { apply(compiler) { compiler.hooks.done.tap('TeamCityErrorPlugin', (stats) => { stats.compilation.errors.forEach(error => { + const type = 'error' if (error instanceof ModuleNotFoundError) { error.dependencies.forEach(dependency => { - console.error(formatMessage(TYPED_MESSAGE, `Module '${dependency.request}' not found`, 'error')) + console[type](formatMessage(TYPED_MESSAGE, `Module '${dependency.request}' not found`, type)) }) return } - console.error(formatMessage(TYPED_MESSAGE, error.message, 'error')) + console[type](formatMessage(TYPED_MESSAGE, error.message, type)) }) stats.compilation.warnings.forEach(warning => { - console.warn(formatMessage(TYPED_MESSAGE, warning.message, 'warn')) + const type = 'warn' + + console[type](formatMessage(TYPED_MESSAGE, warning.message, type)) }) }); }