is there any approach to create mock object in tes...
# multiplatform
m
is there any approach to create mock object in tests of the common module for android/ios project? Tried to use Mockk, but common tests fails while run building common ios code, but passes while run building common android code.
t
Mockk doesn't support native yet: https://github.com/mockk/mockk/issues/58 Afaik there is currently no way for creating mocks in kotlin/native. As workaround you can declare interfaces and provide stubs to your classes test under test.
r
Yeah there's not really a good solution to this yet. It's a good reason to prefer using interfaces in external-facing API so you at least have the ability to manually create mock/fake implementations for your tests
m
Thanks!