Funny enough, I also want to announce a new Kotlin/Multiplatform mocking library: Micro-Mock.It uses KSP to generate mocks, and more or less replicates “classic” mocking systems.
Here’s a sample:
The following limitations apply:
• Mocking only applies to interfaces• Faking only applies to concrete treesThe processor generates:
• Mocks of interfaces, allowing to mock behaviour & verify calls.
• Fakes of data classes, filling them of nulls, zeros, empty strings, and alike.
• Injector for test classes.
You’ll find it here : https://github.com/Kodein-Framework/Micro-MockWe are using this in some of our own Multiplatform tests.
I hope it will be useful to the community 😉