Skip to content

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

@collinjackson

Description

@collinjackson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    packageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions