Kotlin test toolkit with flexible styles, rich assertions, property testing, and targets from JVM through native and JS.
Overview
Kotest is a testing framework for Kotlin projects that combines a test runner, assertion library, and property-based testing in one ecosystem. It supports multiple test styles, deep nesting, readable test names, coroutines at all levels, parameterized and data-driven cases, lifecycle callbacks, and configurable parallelism.
The assertion module offers hundreds of matchers with idiomatic Kotlin syntax, collection inspectors, grouped assertions, and extensions for Arrow, JSON, and kotlinx-datetime. Property testing generates values for many types, supports shrinking, composed generators, seeds, and coverage metrics.
Multiplatform coverage includes JVM, JavaScript, Kotlin Native on Linux, Windows, iOS, macOS, tvOS, watchOS, Wasm, and Android unit or instrumented tests, wired through standard Kotlin Gradle tasks. Integrations exist for Spring, Koin, Testcontainers, Blockhound, Micronaut, and custom extensions via Kotest's plug-in model.
Key features
- Multiple nested test styles
- Coroutine-aware test execution
- Parameterized and data-driven tests
- 350 plus assertion matchers
- Property testing with generators
- JVM JS Native Wasm Android targets
- Spring Testcontainers integrations
- Gradle Kotlin multiplatform tasks
Use cases
- Kotlin unit and integration tests
- Multiplatform shared test suites
- Property-based API validation
- Spring or Micronaut service tests