JavaScript testing #11. Spying on functions. Pitfalls of not resetting Jest mocks
Jest offers a lot of functionalities for mocking functions and spying on them. Unfortunately, there are some pitfalls we need to watch out for. In this article, we explain how spying on functions works. We also explain how and why we should reset our mocks. Creating mock functions The most straightforward way of creating a […]