-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocking Getx controller for flutter widget testing #446
Comments
I suspect this problem is fixed in a recent version of
Ouch, mockito should definitely throw rather than generate this code. In any case, the problem is that GlucoseController has methods which seem to reference private types: You might be able to get around this shortcoming by specifying your own fallback generators (in |
Indeed it looks like the get authors do not want GetLifeCycle to be subclassed, as per onStart:
I understand that you are likely not overriding the getter, but mockito needs to, in order to return a non-null value. |
The changes related to this issue broke quite a few of my mocks which previously worked. |
@kuhnroyal You may have responded to the wrong issue. I don't see how your comments relate to this issue...
What changes?
What is? |
You linked it in the changelog for 5.0.17 - in any case, that version breaks builds and it looks like this fits as I suddenly have invalid mocks. |
Ah I understand. Thanks for the info. Can you please file an issue with the problem with a reproduction case? Including the mocks-in-question generated by 5.0.16 and the error reported by 5.0.17 would be very helpful. Thanks! |
solution for this issue? |
I am getting two exception in the GeneratedMock file:
This exception can be found in the _FakeRx, _FakeRxList and _FakeRxBool
'Object.==' ('bool Function(Object)') isn't a valid concrete implementation of 'RxObjectMixin.==' ('bool Function(dynamic)').
This exception is given for _i3._InternalFinalCallback
Classes and mixins can only implement other classes. Try specifying a class or mixin, or remove the name from the list.
How would you solve this issue and why am I getting it? (Sorry if it is something obvious, first time using mockito and getx )
Full code:
The text was updated successfully, but these errors were encountered: