> android-testing

Standards for Unit Tests, UI Tests (Compose), and Hilt Integration. Use when writing unit tests, Compose UI tests, or Hilt test modules in Android. (triggers: **/*Test.kt, **/*Rule.kt, @Test, runTest, composeTestRule)

fetch
$curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/android-testing?format=md"
SKILL.mdandroid-testing

Android Testing Standards

Priority: P0

Implementation Guidelines

Unit Tests

  • Scope: ViewModels, Usecases, Repositories, Utils.
  • Coroutines: Use runTest (kotlinx-coroutines-test). Use MainDispatcherRule to mock Main dispatcher.
  • Mocking: Use MockK.

UI Integration Tests (Instrumentation)

  • Scope: Composable Screens, Navigation flows.
  • Rules: Use createAndroidComposeRule + Hilt (HiltAndroidRule).
  • Isolation: Fake repositories in DI modules (@TestInstallIn).

Anti-Patterns

  • Real Network: **No Real APIs**: Always mock network calls.
  • Flaky Delays: **No Thread.sleep**: Use IdlingResource or 'waitUntil'.

References

┌ stats

installs/wk0
░░░░░░░░░░
github stars341
██████████
first seenMar 17, 2026
└────────────

┌ repo

HoangNguyen0403/agent-skills-standard
by HoangNguyen0403
└────────────

┌ tags

└────────────