CtrlK
BlogDocsLog inGet started
Tessl Logo

android-testing

Write Unit Tests, UI Tests (Compose), and Hilt-integrated tests for Android. Use whenever writing Android test files or asking about runTest, composeTestRule, HiltAndroidRule, MockK, MainDispatcherRule, @TestInstallIn, or how to test a ViewModel/Composable/Repository in Android. (triggers: **/*Test.kt, **/*Rule.kt, @Test, runTest, composeTestRule, HiltAndroidTest, MockK, createAndroidComposeRule, MainDispatcherRule, @TestInstallIn)

75

Quality

68%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Optimize this skill with Tessl

npx tessl skill review --optimize ./skills/android/android-testing/SKILL.md
SKILL.md
Quality
Evals
Security

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

  • No Real Network in Tests: Always mock with MockK or fake repositories via @TestInstallIn.
  • No Thread.sleep: Use IdlingResource or composeTestRule.waitUntil for async timing.

References

  • Test Rules
Repository
HoangNguyen0403/agent-skills-standard
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.