I am trying to test whether componentWillMount was called and for that my test is
test(\'calls `componentWillMount` before rendering\', () => { let fn =
Try this:
test('calls `componentWillMount` before rendering', () => { const onWillMount = jest.fn(); SomeComponent.prototype.componentWillMount = onWillMount; mount(); expect(onWillMount).toBeCalled(); });