这是indexloc提供的服务,不要输入任何密码
Skip to content

[flutter_tools] remove mocks from device test #82472

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

Merged

Conversation

jonahwilliams
Copy link
Contributor

Work towards #71511

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 13, 2021
@google-cla google-cla bot added the cla: yes label May 13, 2021
@jonahwilliams jonahwilliams requested a review from jmagman May 13, 2021 20:20
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

verify(mockDeviceDiscovery.devices).called(1);
verifyNever(mockDeviceDiscovery.discoverDevices(timeout: anyNamed('timeout')));
expect(deviceDiscovery.devicesCalled, 1);
expect(deviceDiscovery.discoverDevicesCalled, 0);
});

testUsingContext('refreshes device cache with a timeout', () async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the two testUsingContext in this file can be made testWithoutContext, and then you can remove the context.dart import.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants