Skip to content

Have a way to reset a stubbed mock number of calls #525

@fredo514

Description

@fredo514

Hi,

I have a use case where I need to ignore a function call a bunch of times, then attach a stub for which I need to sequence the return value. My solution was to make an array of return values and index into it with the nbCalls parameter, but I can't easily set it up, since I don't know how many time the function has been called before.

Re-registering the stub doesn't seem to reset the count.

It would be really useful to have an explicit function to reset a given function's mock number of calls, or at least reset it by registering the stub again.

Thanks,

Metadata

Metadata

Assignees

No one assigned

    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