Mocking React hooks for testing with Jest and react-testing-library
Mocking strategies for modern React components
2 min readJul 19, 2020
Imagine this familiar scenario: a developer builds a life-changing todo application using React and has decided to leverage hooks to make the sharing of state logic much cleaner. Being a responsible developer with a passion for testing, they bring in jest and…