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
Tobi
05/08/2019, 7:07 PM
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
russhwolf
05/08/2019, 7:20 PM
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