mockito icon indicating copy to clipboard operation
mockito copied to clipboard

Analyzer plugin rule: when call without stub result

Open srawlins opened this issue 6 years ago • 0 comments

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.)

srawlins avatar Jan 08 '19 04:01 srawlins