Skip to content

Commit 94cfb74

Browse files
committed
Add ProjectConfig to kotest-jvm
This gives a concrete example of how/where to add and configure ProjectConfig in JVM projects. The added config adds a test execution timer line to the `./gradlew kotest` output.
1 parent 4d3e888 commit 94cfb74

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package io.kotest.provided
2+
3+
import io.kotest.core.config.AbstractProjectConfig
4+
import io.kotest.core.listeners.AfterTestListener
5+
import io.kotest.core.test.TestCase
6+
import io.kotest.engine.test.TestResult
7+
8+
object TimerListener : AfterTestListener {
9+
override suspend fun afterAny(testCase: TestCase, result: TestResult) =
10+
println("- ${testCase.name.name} ${result.duration}")
11+
}
12+
13+
object ProjectConfig : AbstractProjectConfig() {
14+
override val extensions = listOf(TimerListener)
15+
}

0 commit comments

Comments
 (0)