mockk-testing-patterns

Official

Write 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 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.

Dependency Matrix

Required Modules

None required

Components

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.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.