Is it possible to mock objects/static methods? #99
-
|
Started using this library because I was shocked to learn mockk does not support multiplatform. So far, so good! My one question though is does this library support a way to mock a static method? This has been a crucial capability in mockk for things like mocking current time (Clock.System.Now()) and was hoping there would be a way to achieve this using this library. |
Beta Was this translation helpful? Give feedback.
Answered by
lupuuss
Aug 20, 2025
Replies: 1 comment
-
|
It's not possible. Mockk uses JVM specific mechanisms to achieve that and there are no equivalents for other KMP targets. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lupuuss
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not possible. Mockk uses JVM specific mechanisms to achieve that and there are no equivalents for other KMP targets.