Open yanok opened 2 years ago
It's broader than this, internal state is also messed if thenReturn doesn't succeed:
when(mock).thenReturn(null!)
Probably no easy fix in mockito for this, but maybe an error message can be improved with possible explanations
Could be potentially fixed with https://github.com/dart-lang/mockito/issues/684. Actually I think we could get rid of internal state altogether.
Currently if one generates mocks with
and then trying to set an expectation on
foo.m
, not only the test trying to do this fails (which is expected), but also all the following tests, since unsupported method throws without cleaning_storedArgs
/_storedNamedArgs
and that messes up Mockito internal state.