kotlin.test in commonTest
Write platform-agnostic unit tests once.
Test Once, Trust Everywhere
Shared code deserves shared tests. With kotlin.test you write a single suite that proves your logic on every target. 🧪
Add the Test Dependency
First, pull kotlin.test into your common test source set so the assertions are available on all platforms.
commonTest.dependencies {
implementation(kotlin("test"))
}All lessons in this course
- kotlin.test in commonTest
- Test suspend Functions & Flows
- Fake the Ktor Client & Repos
- Run Tests on Android & iOS Targets