-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[path_provider] Remove use of Pigeon's Dart test generator #10323
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
base: main
Are you sure you want to change the base?
[path_provider] Remove use of Pigeon's Dart test generator #10323
Conversation
- Updates `path_provider_android` to use DI to inject the fake Pigeon API implementation, instead of the Dart test generator, following the pattern of newer plugins in the repo. - Does the same for `path_provider_foundation`, and also replaces the use of mockito with a trivial fake, to simplify test maintenance. Part of flutter/flutter#159886
4f503c7 to
0a53933
Compare
|
CHANGELOG/version overrides: While technically there is a production code change here, it's just adding an optional, visibible-only-for-tests parameter, and moving one ivar initialization from the declaration to the constructor, so it's pretty clearly a no-op. |
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.
Code Review
This pull request refactors the tests for path_provider_android and path_provider_foundation to no longer use Pigeon's Dart test generator. Instead, it uses dependency injection to provide a fake API implementation for testing. For path_provider_foundation, it also removes the dependency on mockito in favor of a simpler manual fake. The changes align with modern practices in the repository and simplify test maintenance. I have one suggestion to improve the test clarity in path_provider_android by adopting the more explicit fake implementation pattern used in path_provider_foundation.
packages/path_provider/path_provider_android/test/path_provider_android_test.dart
Show resolved
Hide resolved
camsim99
left a comment
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.
Android changes LGTM!
path_provider_androidto use DI to inject the fake Pigeon API implementation, instead of the Dart test generator, following the pattern of newer plugins in the repo.path_provider_foundation, and also replaces the use of mockito with a trivial fake, to simplify test maintenance.Part of flutter/flutter#159886
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3