Allow to reset the value of MockFunctionContext.#calls
#45795
Labels
feature request
Issues that request new features to be added to Node.js.
What is the problem this feature will solve?
I use globally mocked objects in my tests to allow them to run without an environment:
Because it's global, tests can pollute each other:
What is the feature you are proposing to solve the problem?
I want to be able to reset
mailer.sendMail.mock.calls
:node/lib/internal/test_runner/mock.js
Lines 46 to 52 in 8a4d7ac
It could be as simple as:
If you're okay with this design, I'm interested in creating a PR with the feature and associated tests.
What alternatives have you considered?
Use another mocking library
Current workaround
I resorted to this hack:
The text was updated successfully, but these errors were encountered: