Skip to content

omuomugin/kotest-gradle-plugin

 
 

Repository files navigation

kotest-gradle-plugin

build

Gradle plugin for running JVM tests with Kotest. Requires Kotest 4.3.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.3.7"
}

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.3.7

  • Updated to work with gradle 7

About

A gradle plugin for Kotest

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%