Remove spy.reset
See original GitHub issueThe meaning of spy.reset is ambiguous (see discussion in #138). What exactly does it reset? The call count? The return/thrown values?
My vote is to either remove it or make its meaning more clear. If we remove it, the simple upgrade path is to substitute all uses of spy.reset() with spy.calls = []. Super easy.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Will Factory Reset Remove Spy App? Tried & Tested
Yes, a factory deletes everything including photos, apps, contacts, and spyware from the phone. Can You Uninstall Spyware? Spy apps basically ...
Read more >How to reset or clear a spy in Jest?
So we can use mockClear to "reset" a spy. ... In jest.config.js add mockReset - not clearMocks, as that will not remove any...
Read more >Does factory reset on Android remove spywares?
Yes, you can get rid of spyware by a factory reset! Roberto's answer is very wrong and is talking about xHelper which is...
Read more >Bring back spy.reset() · Issue #104 · chaijs/chai-spies
A previous issue #27 introduced the reset method to this library which we use extensively. It was removed in 1.0 for no clear...
Read more >Jest set, clear and reset mock/spy/stub implementation
Between test runs we need mocked/spied on imports and functions to be reset so that assertions don't fail due to stale calls (from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

ie, it can’t be easily thrown away, so it’s helpful to reset its state.
It looks like proxyquire is using sinon for its spies implementation. Besides, seems like in the case you describe proxyquire would be creating incidental complexity and forcing me to handle it. Feels like a leaky abstraction.