Quick & Easy Way To Reset Mocks & Spies In Jest - I Like Kill Nerds

added by JavaScript Kicks
12/21/2019 8:03:07 AM

570 Views

When working with mocks and spies in Jest, it is quite easy to fall into a trap where they become stale (especially in cases where pure functions are not being used). Heading to the documentation for Jest yields a lot of similar-looking methods for restoring mocks, clearing mocks and resetting mocks.


0 comments