0Pricing
Kotlin Multiplatform Academy · Lesson

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

  1. kotlin.test in commonTest
  2. Test suspend Functions & Flows
  3. Fake the Ktor Client & Repos
  4. Run Tests on Android & iOS Targets
← Back to Kotlin Multiplatform Academy