mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-09-22 03:35:06 -04:00
170 lines
10 KiB
HTML
170 lines
10 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en" dir="ltr">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Testing</title>
|
||
<link rel="stylesheet" href="../styles/docs.css">
|
||
</head>
|
||
<body data-page="testing" data-locale="en">
|
||
<pre class="markdown-content"># 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:
|
||
|
||
- ** |