Nice article! How did you test/mock the code with context receivers? Because I also tried to use them and while the feature itself works nicely I couldn't reliably mock the methods with context receivers (using mockk in my case).
🤔 1
y
Yves Kalume
01/09/2023, 6:01 PM
That's an interesting question 🤔 I'll try to investigate.
I am wondering in what situation you can have to mock something that must be used within a particular context outside of it.
Yves Kalume
01/09/2023, 6:10 PM
But you can still use the
with
operator
d
David Kubecka
01/09/2023, 9:46 PM
Well, I tried that in the past and even created an issue: https://github.com/mockk/mockk/issues/995. I just wondered whether you didn't come up with some clever workaround 🙂