android-test
android-test copied to clipboard
Improve error message for androidx.test.espresso.contrib.ActivityResultMatchers#hasResultCode
If there's a mismatch with ActivityResultMatchers#hasResultCode, you currently get an error message like this one, not showing the actual value:
java.lang.AssertionError:
Expected: has result code -1
but: was <android.app.Instrumentation$ActivityResult@af47c58>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
Please override describeMismatchSafely with something like
mismatchDescription.appendText("result code was " + item.getResultCode());