Good morning/afternoon guys, I found that kmp is struggling with mocking. Is it possible to do the tests on android side only so it can use junit?
j
jw
02/02/2025, 4:47 PM
Are these two separate questions? The Android tests will use JUnit. By default it's JUnit 4, or if you want JUnit 5 you can so choose.
jw
02/02/2025, 4:48 PM
I would avoid mocking completely. Practice inversion of control, single responsibility, and fakes, and you'll never need it. I haven't used a mock in more than a decade now, and my life is so much better for it.
💯 8
n
Novo Dimaporo
02/02/2025, 11:41 PM
Hi @jw, I think I misunderstood something. I was trying to ask if I can do my business logic layer on androidMain so I can use the mocking libraries that doesn’t necessarily need to run in kotlin only. But I think I will look into those things you mention to avoid mocking. Thanks so much for the direction! 👋
Novo Dimaporo
02/02/2025, 11:50 PM
Turns out it is so much easier to generate fakes using AI. blob joy Thanks a lot!