This repo contains multiple examples of how to use Kotest.
- JVM — example of a JVM project
- Multiplatform — example of a multiplatform project with JVM, JS and Native modules
- Javscript — example of a JavaScript project
- Native — example of a native project with Linux, Windows and Mac targets
- Spring Data JPA — example of a JVM project using Spring Data JPA
- Spring Webflux — example of a JVM project using Spring Webflux
- Allure — example of a JVM project using Allure test reporting
- Wasm — example of a Wasm project
- Android — example of an Android project
- Gradle-test-retry — example of a project using the Gradle test retry plugin.
- Maven — example of a project using Apache Maven with Kotest rather than Gradle.
- Amper — example of a project using Amper with Kotest rather than Gradle.
- Multi-module — example of a Gradle multi-project build (
include). - Composite build — example of a Gradle composite build (
includeBuild) with the wrapper and version catalog only at the root.
All modules support overriding the Kotest version via environment variables. This is useful for CI workflows that need to test against a specific or newly-built Kotest version.
| Variable | Description |
|---|---|
KOTEST_VERSION |
Overrides the Kotest library dependencies version |
KOTEST_GRADLE_PLUGIN_VERSION |
Overrides the io.kotest Gradle plugin version |
# Run tests with a specific Kotest library version
cd kotest-jvm
KOTEST_VERSION=6.0.3 ./gradlew test
# Run tests with a specific Gradle plugin version
KOTEST_GRADLE_PLUGIN_VERSION=6.0.3 ./gradlew test
# Override both library and plugin versions (useful when they differ)
KOTEST_VERSION=6.1.0 KOTEST_GRADLE_PLUGIN_VERSION=6.0.3 ./gradlew test
# Or for any other module
cd kotest-multiplatform
KOTEST_VERSION=6.1.0 ./gradlew testWhen no override is provided, each module uses the version from its gradle/libs.versions.toml.