testing-setup
Installation
SKILL.md
Step 1: Analyze the current testing setup
To understand the testing setup of an existing project, look for these key dependencies in the project's configuration (e.g., libs.versions.toml or build.gradle):
- Dependency Injection: Identify the framework (e.g., Hilt, Koin, vanilla Dagger).
- Unit Testing: Identify the core framework (e.g., JUnit 4, JUnit 5).
- Mocking/Fakes: Identify the preferred approach (e.g., MockK, Mockito, or Manual Fakes).
- Coroutine & Flow Testing: Check for utilities like
kotlinx-coroutines-testandTurbine. - Simulation Engine: Check if the project uses Robolectric for JVM-based UI testing.
- Visual Regression: Identify if a screenshot tool is used (e.g., Roborazzi, Paparazzi, Dropshots, Shot).
- Environment: Ensure the JDK version is compatible with the project's
compileSdkand testing tools.
Step 2: Set up the Testing Infrastructure
Configure the chosen frameworks following their official guidelines. Ensure that:
- Testing dependencies are correctly scoped (
testImplementation,androidTestImplementation,kspTest, etc.). - A clear boundary exists between production and test code (e.g., using a
TestApplicationclass for DI isolation).