Is there a guide anywhere for using mockk and kote...
# kotest
m
Is there a guide anywhere for using mockk and kotest together? I am trying to convert some tests that use
@Mock
etc... annotations with `MockKAnnotations.init(this, relaxUnitFun = true)`` and haven't found a good way of doing it yet. I have been using
BehaviourSpec
to implement the tests
I found the guide on kotest.io for mocking, which I guess means I have to abandon annotated mocks, which is ok and feels more natural anyway after changing things
d
Just don't forget to clear them, or use InstancePerTest mode...
👍 1
m
Can you set isolation mode at the start of the Spec instead of at the end?
d
Yes. Either override isolationMode, or just use the dsl
Or you can do it for the whole project in ProjectConfig
🙌 1
m
or just use the dsl
The DSL? Which one there a a few kotest DSLs 😄
s
so you can do
Copy code
class MySpec : FunSpec({
   isolationMode = IsolationMode.Foo
})
And that var assignment can go anywhere in the body
Or in project config for all specs at once
m
Thanks!