Hi guys. Is it possible to mock `property extensio...
# mockk
d
Hi guys. Is it possible to mock
property extension
? I've been trying something like this (see below) but it doesn't work. I just can't find anything about it in the Mockk documentation or anywhere else
Test+Extensions.kt
Copy code
fun List<String>.test(): String { ... }

val List<String>.someProperty: String get() = ...
MyTests.kt
Copy code
mockkStatic("<mypackage>.Test_ExtensionsKt")
val spy = spyk(listOf("Hi"))

// this works
every { spy.test() }.returns("test")

// this doesn't
every { spy.someProperty }.returns("test")