Skip to content
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

Remove mockito MethodChannel mocks from first-party plugins unit tests #34284

Closed
1 of 7 tasks
collinjackson opened this issue Jun 11, 2019 · 2 comments
Closed
1 of 7 tasks
Labels
package flutter/packages repository. See also p: labels.

Comments

@collinjackson
Copy link
Contributor

collinjackson commented Jun 11, 2019

Right now some of our first-party plugins tests use mockito to mock out MethodChannel and others use dependencies on mockito and some use setMockMethodCallHandler.

This results in contributors writing more tests in a deprecated test style (see flutter/plugins#1067) because they're adding to existing test suites or copying test code from other first-party plugins.

Here are the steps to remove dependencies on mockito:

  • Update contribution guide with a note that the plugins team prefers tests written using setMockMethodCallHandler instead of mockito and may ask tests using mockito to be rewritten.
  • Update firebase_analytics tests
  • Update battery tests
  • Update firebase_messaging tests
  • Update share plugin tests
  • Remove mockito pubspec dependency from firebase_admob
  • Remove mockito pubspec dependency from firebase_database
@collinjackson collinjackson changed the title Remove mockito from first-party plugins unit tests Remove mockito MethodChannel mocks from first-party plugins unit tests Jun 11, 2019
@collinjackson
Copy link
Contributor Author

collinjackson commented Nov 21, 2019

This is no longer a thing since testing of platform interfaces is using mockito.

See https://github.com/FirebaseExtended/flutterfire/pull/1472/files

/cc @amirh

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package flutter/packages repository. See also p: labels.
Projects
None yet
Development

No branches or pull requests

1 participant