Testing
Testing strategy and practices for the Meshtastic KMP project.
Test categories
KMP unit tests (commonTest)
Shared tests that run on all platforms:
./gradlew allTests
- Business logic tests
- Data model validation
- Search/ranking algorithm tests
- Route serialization tests
Android host tests
Android-specific tests that run on JVM:
./gradlew test
- ViewModel tests
- Repository tests with Room fakes
- Android-specific integration tests
Compose UI tests
Compose Multiplatform UI test framework:
@Test
fun myScreenTest() = runComposeUiTest {
setContent { MyScreen() }
onNodeWithText("Expected").assertIsDisplayed()
}
Located in commonTest or jvmTest source sets.
Screenshot tests
Uses Android Gradle Plugin’s native (layoutlib) screenshot testing framework, split across two modules: