Skip to main content
Version: 6.0 🚧

Setup

The Kotest test framework is supported on JVM, Javascript and Native. To enable Kotest for multiple platforms, combine the steps for the individual platforms as detailed in the following tabs.

caution

The KMP support in Kotest 6.0 has changed from the previous versions. There is no longer a compiler plugi but a simplified setup. Please see the rest of this page for details on how to configure Kotest for KMP in Kotest 6.0 and later.

tip

A working project with JVM support can be found here: https://github.com/kotest/kotest-examples

Kotest on the JVM has two ways for running tests. One uses the Kotest gradle plugin, which provides detailed test output in the console, and a rich experience in Intellij (in conjuction with the Intellij Kotest plugin). The other option uses the JUnit Platform gradle plugin which is ubiquitous in the JVM ecosystem but lacks some features of the Kotest gradle plugin.

To use the Kotest gradle plugin, add the following to your build.gradle.kts file:

plugins {
id("io.kotest") version "$version"
}

Add the following dependency to your build:

dependencies {
testImplementation("io.kotest:kotest-framework-engine:$version")
}

And then execute the kotest task in gradle, or run tests directly from the IDE.

To use the JUnit Platform plugin, add the following to your build.gradle.kts file:

tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

Add the following dependency to your build:

dependencies {
testImplementation("io.kotest:kotest-runner-junit5:$version")
}

And then execute the test task in gradle, or run tests directly from the IDE.