What problem does it solve?
This Skill helps you reliably mock Kotlin collaborators in JVM unit tests when suspend functions, coroutines, and Kotlin object/singletons are involved, so your tests can verify interactions without brittle workarounds.
Core Features & Use Cases
- Suspend-safe stubbing and verification: Use
coEvery { ... } returns ... and coVerify { ... } to avoid runBlocking-style wrappers and to prevent Continuation-matching errors.
- Kotlin-native mocking coverage: Mock Kotlin
object/singleton behavior (mockkObject), statics (mockkStatic), and constructors (mockkConstructor) with proper cleanup.
- Strict interaction testing with argument capture: Capture arguments via
slot<T>(), enforce call ordering using verifySequence / verifyOrder, and guard against unexpected calls using confirmVerified.
Quick Start
Tell the AI to generate a JVM unit-test setup that uses MockK to stub a suspend repository method with coEvery, verify it with coVerify, capture a saved entity with slot, and include unmockkAll() teardown when any static/object/constructor mocking is used.