What problem does it solve?
It prevents flaky or incorrect unit/instrumentation tests by guiding you to use the right MockK primitives (every/coEvery/verify/coVerify), the correct test source set, and AniTrend’s existing Koin + coroutine + Turbine patterns.
Core Features & Use Cases
- Correctly choose
test vs androidTest based on whether Android runtime behavior is required.
- Use coroutine-aware stubbing and verification via
coEvery/coVerify for suspend paths and every/verify for regular calls.
- Assert
Flow/DataState emissions with Turbine, focusing on observable contract instead of internal implementation.
- Validate Koin DI graphs using
MockProviderRule.create { mockk() } without inventing custom wiring.
- Keep mocks minimal and meaningful, mocking collaborators (gateways/DAOs/interactors) rather than value objects or the subject under test.
- Review and completion guardrails to avoid redundant dependencies and brittle over-verification.
Quick Start
Use mockk-testing-patterns when you need to stub or verify suspend and non-suspend collaborators in an AniTrend unit test, including Flow assertions with Turbine, and follow the rule to keep MockK dependencies managed by buildSrc.