any idea how to use mockk in kotlin multiplatform?...
# multiplatform
r
any idea how to use mockk in kotlin multiplatform? the old
io.mockk:mockk-common
works but only until 1.12.5, their changelog says they support KMP now in
io.mockk:mockk
without
-common
suffix but it doesn’t work for me my app supports Android and iOS
Copy code
Could not resolve io.mockk:mockk:1.13.2.
  Required by:
      project :shared
   > No matching variant of io.mockk:mockk:1.13.2 was found. The consumer was configured to find a library for use during 'kotlin-api', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute
j
MockK only supports JVM targets: https://github.com/mockk/mockk/blob/master/modules/mockk-core/build.gradle.kts. So it's multiplatform in the sense that it can be used on JVM and Android, but not on iOS.
1
p
There is a list of Test (and Mock) Libs/Frameworks at https://github.com/AAkira/Kotlin-Multiplatform-Libraries?tab=readme-ov-file#test mockk ist also listed there, but only for jvm and android Maybe you'll find a suitable alternative for your needs there.
1
r
ah, thanks both for answering and sharing! will check the links