Skip to content

Flutter should be upgraded to Dart 2 compliant mockito #14532

Closed

Description

@mraleph

Current issue of mockito is 2.2.1 (latest stable release), however it is not fully Dart 2 compliant:

compiler message: file:///usr/local/google/home/vegorov/.pub-cache/hosted/pub.dartlang.org/mockito-2.2.1/lib/src/mock.dart:680:32: Error: A value of type '(#lib1::_VerifyCall) → #lib1::Mock' can't be assigned to a variable of type '(dynamic) → dynamic'.
compiler message: Try changing the type of the left hand side, or casting the right hand side to '(dynamic) → dynamic'.
compiler message:             tmpVerifyCalls.map((_VerifyCall vc) => vc.mock).toSet();
compiler message:

This makes tests using mockito fail when running in Dart 2 mode.

This issue is to track an upgrade when it becomes available. Currently only unstable 3.0.0-alpha is available.

Currently the only test in Flutter repository, I know about, that is using package mockito is packages/flutter/test/material/animated_icons_test.dart

/fyi @a-siva @srawlins

Activity

  1. self-assigned this
    on Feb 7, 2018
  2. srawlins commented on Feb 9, 2018

    @srawlins
    Contributor

    Mockito 2.2.2 is now available which should solve the issue.

  3. added a commit that references this issue on Feb 9, 2018
    f5bbc5b
  4. added a commit that references this issue on May 14, 2018
    04d1b66
  5. github-actions commented on Sep 3, 2021

    @github-actions

    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.

  6. locked as resolved and limited conversation to collaborators on Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions