Skip to content

kotest/kotest-gradle-plugin

Repository files navigation

kotest-gradle-plugin

build

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.

How to use

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.

Example Output

output image

Another example with failure:

output image with failure

Errors are again summarized at the end for easy digesting:

output image with failure

Changelog

0.4.0

Requires Gradle 7.5+

  • Updated to Kotest 5.5.5
  • Kotlin version updated to 1.6.10

0.3.8

  • Added --tags option

0.3.7

  • Updated to work with gradle 7