Skip to content

Analyzer plugin rule: when call without stub result #184

Open
@srawlins

Description

@srawlins

Mockito cannot throw any errors for this code, even though no stub result has been set:

void main() {
  var a = MockA();
  when(a.m1());
  print('hey');
  print('boo');
  verify(a.m1());
}

(Actually, maybe it could throw on that verify... but the error cannot point to the when which is currently in progress. It would be much better to report a static analysis error on when statement.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onS2type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions