Hey everyone, I'm planning to add unit and integra...
# multiplatform
v
Hey everyone, I'm planning to add unit and integration testing to my KMP Project (Android and iOS), which has Multi-module architecture, uses Ktor, Coroutines, Flows, Koin, Decompose etc As I am new to testing Can you all suggest me which testing frameworks and library I must be using.. Kotlin Test vs Kotest and any other must have libraries for testing
f
At least, Kotest plugin doesn’t support KMP module.
The IntelliJ Kotest plugin does not support running common, native or JS tests from the IDE. You will need to use the gradle check task.
it’s working but the dev experience is not optimal
Kotlin Test is working fine and you can complete with code overage https://github.com/Kotlin/kotlinx-kover (only test targeting the JVM)
For testing coroutine https://github.com/cashapp/turbine is also a good tool
v
Thanks a lot for these Is Kotlin Test similar to Kotest in terms of functionality? Any Pros and Cons ?
f
Kotlin Test is basically JUnit testing
Kotest can do more complex scenario, BDD and more
v
I see, and In Kotlin-Test all these complex scenarios needs to be done manually?
f
v
Thanks, I'll check these out
f
v
Is there anything apart from running test via IDE that Kotest cannot do, which Kotlin-Test can?
f
Kotest-Test give basic testing capabilities (Annotation/Assertion and other small tools), it’s a lightweight JUnit.
Kotest better integration with third party libs, different writing way to make test and a lot of stuff.
v
Yeah, I was going through the extensions, non-deterministic testing in Kotest, It looks quite handy in a lot of scenarios
f
Yes sure, it has a lot of builtin tools. Kotlin-Test need more external dependencies, it depends on what your code uses.
v
Thanks a lot
h
+1 for kotlin test