Kairo Testing
kairo-testing brings together a curated set of tools and defaults
that make testing feel natural & fast.
It’s built on proven foundations.
- JUnit: Battle-tested test runner.
- Kotest: Expressive matchers and assertions.
- MockK: Kotlin-idiomatic mocking.
- Kotlin’s own coroutines testing library.
Instead of stitching these together yourself,
kairo-testing gives you a ready-to-go test environment with sane defaults.
class YourTest { @Test fun test(): Unit = runTest { doSomething(1).shouldBe("wonderful result!") }}Installation
Section titled “Installation”Install kairo-testing.
dependencies { testImplementation("software.airborne.kairo:kairo-testing")}First, configure testing in your Gradle build file.
test { testLogging { exceptionFormat = TestExceptionFormat.FULL events("passed", "skipped", "failed") } useJUnitPlatform()}A note about concurrency
Section titled “A note about concurrency”kairo-testing runs tests concurrently by default.
If your use case cannot support this,
create a file called junit-platform.properties in your project’s test resources,
and set junit.jupiter.execution.parallel.enabled to false.
A note about timeouts
Section titled “A note about timeouts”kairo-testing uses a default test timeout of 10 seconds.
If your use case cannot support this, you have two options.
- To override per test, use
runTest(timeout = 10.seconds)instead. - To override globally,
create a file called
kotest.propertiesin your project’s test resources, and setkotlinx.coroutines.test.default_timeoutto some higher value.
Integration tests
Section titled “Integration tests”Integration testing for Kairo applications is handled using a different library: kairo-integration-testing.