Does anyone know how to mock/suppress a `init {}` block of companion object?
g
Does anyone know how to mock/suppress a
init {}
block of companion object?
p
Following this question. But I think it isn't possible.
e
I don't think it's possible without some sort of instrumentation system that replaces classes before the test is even loaded
just referencing the class causes the classloader to run
<clinit>
which runs the companion's
<init>
, well before anything MockK has control over
g
Do u know any libraries which can do that? @ephemient
e
no
169 Views