How to mock a React component lifecycle method with Jest and Enzyme?
The Enzyme docs for Full DOM Rendering here contains the following example of spying on a lifecycle method with Sinon: describe('<Foo />', () => { it('calls componentDidMount', () => { sinon.spy(Foo.prototype, 'componentDidMount'); const wrapper = mount(<Foo />); expect(Foo.prototype.componentDidMount.calledOnce).to.equal(true); }); }); What is the equivalent to this using mock functions from Jest? I'm using Create-React-App, and would rather not include Sinon if the same can be achieved with Jest. Here's what I'd expect the test to look like: describe('<App />', () => { it('calls