Skip to content

fallbackGenerators are actually called from real calls #588

Open
@yanok

Description

@yanok

The documentation for fallbackGenerators says:

The fallback values will never be returned from a real member call; these are not stub return values. They are only used internally by mockito as valid return values.

... but the actual generated code has

returnValueForMissingStub: _i10.getShim<T>(flag)

(where getShim is my fallback generator), so it does actually call fallback generator if the stub is missing and returns values to the caller. I've seen people even relying on this ;(

So, should we fix the doc or the behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requesttype-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