Hi, i am trying to throw an error using mockk with...
# mockk
s
Hi, i am trying to throw an error using mockk with flow method but is not working.
Copy code
every { manager.startFunction() } throws(error)
I don´t find any solution, can someone help me please? Thanks.
g
What is "flow method"? Is this startFunction return Flow? You probably want this: every { manager.start() } returns flow { throw error }
So it will create a flow which emits error on subscription
s
Ok later i will try yo test it. Thanks. Startfunction() return flow yeah