Mockk is a mocking library for ๐Ÿง‘โ€๐Ÿ’ป๏ธ Kotlin.

Tips and tricks

  • Use relaxUnitFun = true instead of relaxed = true to require all mocks to be defined
  • checkUnnecessaryStub to validate that all stub definitions have been called in the code
    • Annotate with @MockKExtension.CheckUnnecessaryStub (documentation)