Skip to content

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

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,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions