mockk-testing-patterns
OfficialWrite reliable MockK tests that match AniTrend
AuthorAniTrend
Version1.0.0
Installs0
System Documentation
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
testvsandroidTestbased on whether Android runtime behavior is required. - Use coroutine-aware stubbing and verification via
coEvery/coVerifyfor suspend paths andevery/verifyfor regular calls. - Assert
Flow/DataStateemissions 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.
Dependency Matrix
Required Modules
None requiredComponents
referencesassets
đŸ’» Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: mockk-testing-patterns Download link: https://github.com/AniTrend/anitrend-v2/archive/main.zip#mockk-testing-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.