Skip to content

Mocks created with GenerateMocks do not throw on missing stub when the function returns a Future<void>Β #581

Open
@Barabas5532

Description

@Barabas5532

A call on a function with the signature Future<void> returnsFutureVoid() => Future.value(); with no expected calls set up with when will not cause a MissingStubError.

I have read through the README, the FAQ and some of the test cases. From what I understand, this error should always be thrown for mocks generated with GenerateMocks. I couldn't find any documented problems with functions that return a future. I was not able to reproduce the issue for the mock in the mockito_test.dart file.

I'll open a pull request with a new test case to demonstrate the issue. If this is a valid bug, I would appreciate any advice on how to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-documentationA request to add or improve documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions