A practical guide to setting up unit testing in a Kotlin Multiplatform (KMP) project using Mokkery, a Mockito-like mocking library for KMP. Covers adding the Mokkery and Kotlin All Open plugins, creating a custom @OpenForTest annotation to enable mocking of concrete classes without interfaces, and writing tests for domain layer use cases with dependency injection via Koin. Includes code examples for mocking repositories, verifying call order with verifySuspend, and testing use cases that depend on other use cases.
Sort: