I've added the dependency for Ktor client mock
testImplementation "io.ktor:ktor-client-mock:$ktor_version"
But still the MockEngine is not resolved.
This is a multi-platform module with no actual implementations. to use in platform modules, jvm in the case of android a corresponding dependency should be used. In this case you should use instead:
testImplementation "io.ktor:ktor-client-mock-jvm:$ktor_version"
I have written an article about Ktor and Ktor client mock where you can review a working example.
https://medium.com/@xurxodev/how-to-create-a-rest-api-client-and-its-integration-tests-in-kotlin-multiplatform-d76c9a1be348
The source code is on this GitHub repository https://github.com/xurxodev/integration-testing-kotlin-multiplatform-kata
Review it and let me know if you have some doubts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With