What is everybody using for writing unit test mock...
# multiplatform
c
What is everybody using for writing unit test mocks in KMP android/iOS projects? I'm looking at Mockative and Mokkery, but would appreciate any insights from current users.
t
Fakes mostly. The simplest of types (entities) can be used as-is. Any types with any decent complexity conform to an interface which gets swapped for a FakeSoAndSo in tests. After mockative was slow to adopt K2, and I found reverting to Jvm-only tests unacceptable, I just started using Fakes for everything. I had already been using fakes to some degree, but relied on spies for verifying invocations, but now I just verify the expected state of the fake, which makes all properties public.
💯 2
Admittedly, I do need to write myself some test utilities because I’ve been more reluctant to write tests since dropping mocks/spies and my test coverage has suffered 😛
t
Mockative was fantastic but has been having trouble keeping up with Kotlin changes. I've resorted to jvm testing for now but not really comfortable with that.
v
Also using fakes here