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
[flutter_test] Adds method to mock EventChannels #123726
Conversation
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.
I really like what you've got here, it cleans things up quite a lot! Just a couple of nits and an API suggestion that I think will improve discoverability.
packages/flutter_test/lib/src/test_default_binary_messenger.dart
Outdated
Show resolved
Hide resolved
packages/flutter_test/lib/src/test_default_binary_messenger.dart
Outdated
Show resolved
Hide resolved
@pdblasi-google Should I just keep merging main into this until the Google Testing passes? |
If this one doesn't work, I'll escalate internally. I've been following a thread on the issues and I think they have been resolved. If you'd like, I have access to the "Update branch" button, so I can follow through on this one 'til it's able to get merged. |
The issue should be resolved and Google testing is working again. May require another rebase to trigger it again, though. |
auto label is removed for flutter/flutter, pr: 123726, due to This PR has not met approval requirements for merging. You have project association NONE and need 1 more review(s) in order to merge this PR.
|
auto label is removed for flutter/flutter, pr: 123726, due to Validations Fail. |
packages/flutter_test/lib/src/test_default_binary_messenger.dart
Outdated
Show resolved
Hide resolved
packages/flutter_test/lib/src/test_default_binary_messenger.dart
Outdated
Show resolved
Hide resolved
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
In case anyone wants to use this code before it's released to stable, I copied this code into the mock_event_channel package. When this PR is released to stable, just remove that package. |
[flutter_test] Adds method to mock EventChannels
Currently there is a way to mock MethodChannels, but no built in way to easily mock EventChannels. This PR adds a
setMockStreamHandler
method to go along with the existingsetMockMethodCallHandler
#26528
#38954
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.