[Gradle, JS] Not all karma messages go through log appenders
#KT-38109 fixed
This commit is contained in:
+7
-3
@@ -69,6 +69,8 @@ class KotlinKarma(override val compilation: KotlinJsCompilation) :
|
|||||||
config.reporters.add("karma-kotlin-reporter")
|
config.reporters.add("karma-kotlin-reporter")
|
||||||
|
|
||||||
confJsWriters.add {
|
confJsWriters.add {
|
||||||
|
// Not all log events goes through this appender
|
||||||
|
// For example Error in config file
|
||||||
//language=ES6
|
//language=ES6
|
||||||
it.appendln(
|
it.appendln(
|
||||||
"""
|
"""
|
||||||
@@ -78,7 +80,8 @@ class KotlinKarma(override val compilation: KotlinJsCompilation) :
|
|||||||
config.loggers = [
|
config.loggers = [
|
||||||
{
|
{
|
||||||
type: 'kotlin-test-js-runner/tc-log-appender.js',
|
type: 'kotlin-test-js-runner/tc-log-appender.js',
|
||||||
layout: { type: 'pattern', pattern: '%[[%c]: %]%m' }
|
//default layout
|
||||||
|
layout: { type: 'pattern', pattern: '%[%d{DATE}:%p [%c]: %]%m' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
@@ -445,8 +448,9 @@ class KotlinKarma(override val compilation: KotlinJsCompilation) :
|
|||||||
val launcherMessage = KARMA_MESSAGE.matchEntire(text)
|
val launcherMessage = KARMA_MESSAGE.matchEntire(text)
|
||||||
|
|
||||||
val actualText = if (launcherMessage != null) {
|
val actualText = if (launcherMessage != null) {
|
||||||
val (_, message) = launcherMessage.destructured
|
val (logLevel, message) = launcherMessage.destructured
|
||||||
when (actualType?.toLowerCase()) {
|
actualType = logLevel.toLowerCase()
|
||||||
|
when (actualType) {
|
||||||
WARN, ERROR -> {
|
WARN, ERROR -> {
|
||||||
processFailedBrowsers(text)
|
processFailedBrowsers(text)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user