Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mock/fake.resetAll() #129

Open
1 task
wei3erHase opened this issue Jun 24, 2022 · 0 comments
Open
1 task

Allow mock/fake.resetAll() #129

wei3erHase opened this issue Jun 24, 2022 · 0 comments
Assignees

Comments

@wei3erHase
Copy link
Member

wei3erHase commented Jun 24, 2022

  • A mock or fake should be able to reset all it's function returns at once

How it works now:

fake.someFunction.returns(1,2,3)
fake.someOtherFunction.returns([3,2])
...
// and then at some other context
fake.someFunction.reset()
fake.someOtherFunction.reset()

This requires the developer to remember to reset all of the set variables and brings unexpected error when forgets to reset a previous return. How it should work:

fake.someFunction.returns(1,2,3)
fake.someOtherFunction.returns([3,2])
...
fake.resetAll()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant