mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-09-20 10:52:22 -04:00
171 lines
10 KiB
Markdown
171 lines
10 KiB
Markdown
---
|
||
title: Testing
|
||
parent: Developer Guide
|
||
nav_order: 7
|
||
last_updated: 2026-09-19
|
||
description: Testing strategy for the Meshtastic KMP project — test categories, screenshot pipeline, baseline profiles, and CI integration.
|
||
aliases:
|
||
- tests
|
||
- unit-tests
|
||
- screenshot-tests
|
||
---
|
||
|
||
# Testing
|
||
|
||
Testing strategy and practices for the Meshtastic KMP project.
|
||
|
||
## Test categories
|
||
|
||
### KMP unit tests (`commonTest`)
|
||
|
||
Shared tests that run on all platforms:
|
||
|
||
```shell
|
||
./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:
|
||
|
||
```shell
|
||
./gradlew test
|
||
```
|
||
|
||
- ViewModel tests
|
||
- Repository tests with Room fakes
|
||
- Android-specific integration tests
|
||
|
||
### Compose UI tests
|
||
|
||
Compose Multiplatform UI test framework:
|
||
|
||
```kotlin
|
||
@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:
|
||
|
||
- ** |