MockK
Mocking library for Kotlin with first-class support for coroutines, object/static mocks and DSL designed around Kotlin idioms.
Our Verdict
Clearly the right mocking library for Kotlin, worth the migration from Mockito for Kotlin-heavy code.
Pros
- Designed around Kotlin idioms from day one
- First-class coroutine and suspend function mocking
- Handles object and top-level function mocks
- Readable DSL versus Mockito-Kotlin glue
Cons
- Slower than Mockito on very large suites
- Mistakes produce cryptic stack traces
- Less Stack Overflow coverage than Mockito
- Mocking everything hides Kotlin design smells
When to Use MockK
Good fit if you need
- Kotlin-idiomatic mocking with coroutine test support
- Object and companion object mocking for Kotlin code
- Verify DSL with natural Kotlin syntax for call assertions
- Mock suspend functions in Kotlin coroutine test suites
Pricing
Price wrong?MockK Pricing
- Pricing Model
- free
- Free Tier
- Yes
- Entry Price
- β
- Enterprise Available
- No
- Transparency Score
- β
Beta β estimates may differ from actual pricing
Estimated Monthly Cost
$25
Estimated Annual Cost
$300
Estimates are approximate and may not reflect current pricing. Always check the official pricing page.
Project Health
Health Score
10
1 day
54d
308
1d
Apache-2.0
Last checked: 2026-04-21
Lock-in Assessment
π Thinking about migrating off MockK?
Get an AI-drafted migration plan + a copy-paste email to MockK support requesting a data export. Pick where you're moving to and tell us your context.
Looking for alternatives to MockK?
Answer 4 quick questions β get an AI-ranked shortlist of tools that match your stack and requirements.
Open AI Tool FinderCommunity Discussion
Comments powered by Giscus (GitHub Discussions). You need a GitHub account to comment.