-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bump mockito and regenerate mocks #22
Conversation
Ping, this is blocking a fix for dart-lang/sdk#53253. |
Looks like the newly generated code produces some issues with the analyzer and the tests. Let me have a look. |
Seems like somehow it won't compile with mockito 5.4.0, but needs at least 5.4.2, I guess. Not sure why the CI job says |
If you simply upgrade the dependency from |
Sorry about that! Thanks for following up and digging into that. I've bumped it. |
Welcome to dependency hell... I guess it's fine if we update the required dart SDK version to |
OK, done! Thanks! |
Like I said, dependency hell... Can you upgrade it to |
And maybe just run |
Sorry about the back-and-forth. I don't have a copy of Dart 2.19.0 or earlier so wouldn't have caught that issue. But it analyzes cleanly with Dart 3.2.3 🤷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, ty!
Thanks a million for your patience 🙏 |
The existing mock files contain a dangerous
Future.value
call, where, for a potentially non-nullable typeS
, we callFuture<S>.value(null)
. ButS
may be non-nullable, so this is dangerous. The dart analyzer will start reporting this. See dart-lang/sdk#53253. See this issue in Flutter for a reference to the fixes made in Flutter.This PR just bumps mockito, and regenerates the mocks, where it starts generating safer code. For an example, see in the diff on line 487 in the old copy. (I wish the diff were more isolated, but import prefixes changed and it looks like some other things.)