You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verification failed: call 1 of 1: View(#1).showError(eq(java.io.IOException), null())). Only one matching call to View(#1)/showError(Throwable, String) happened, but arguments are not matching:
[0]: argument: java.io.IOException, matcher: eq(java.io.IOException), result: -
[1]: argument: null, matcher: null(), result: +
So to confirm I captured the argument passed into showError
Which made the test pass. So it seems that the exception object that gets passed to catch {} function is not the same object that gets thrown? I couldn't find this behavior documented anywhere, so I was naturally wondering if this is expected and why. Most likely this is WAD but I'm trying to understand why the object is not the same and come up with the least clunky way of testing this.
Some things I've tried (which didn't make any difference):
Running everything on MainScope to avoid using TestCoroutineScope normally used in my unit tests
Throwing an exception directly instead of mocking.
The text was updated successfully, but these errors were encountered:
You can disable it via system property, but probably the most efficient solution will be to leverage #2551 when it's there and use it within mock verifiers
I've got a simple Flow:
It's paired with a simple unit test:
However, the test will fail with:
So to confirm I captured the argument passed into showError
Which made the test pass. So it seems that the exception object that gets passed to
catch {}
function is not the same object that gets thrown? I couldn't find this behavior documented anywhere, so I was naturally wondering if this is expected and why. Most likely this is WAD but I'm trying to understand why the object is not the same and come up with the least clunky way of testing this.Some things I've tried (which didn't make any difference):
MainScope
to avoid usingTestCoroutineScope
normally used in my unit testsThe text was updated successfully, but these errors were encountered: