Gradle plugin for running JVM tests with Kotest. Requires Kotest 5.5.x or higher.
This is an alternative to using JUnit5 support and provides better output than the gradle default, especially for nested tests but should be considered alpha.
Add the plugin to your gradle build file:
plugins {
id("io.kotest") version "0.4.0"
}
Ensure your build has the kotest engine dependency and remove the junit5 dependency if this was in your build previously.
dependencies {
testImplementation("io.kotest:kotest-assertions-core-jvm:$version")
testImplementation("io.kotest:kotest-framework-engine-jvm:$version")
}
Then execute the tests at the command line using the kotest
task.
./gradlew kotest
Or from within intellij under the gradle -> tasks -> verification -> kotest task.
Another example with failure:
Errors are again summarized at the end for easy digesting:
Requires Gradle 7.5+
- Updated to Kotest 5.5.5
- Kotlin version updated to 1.6.10
- Added --tags option
- Updated to work with gradle 7