title: jest/enzyme mock function in functional component
body: <p>I have a functional component and I wanted to test it with mock function 
  (simplified demonstration)</p>
  
  <pre><code>const remove = () =&gt; {
    ... do something
  }
  
  const removeButton = (props) =&gt; (
    &lt;Button onClick={() =&gt; remove()}&gt;
      Remove
    &lt;/Button&gt;
  );
  </code></pre>
  
  <p>I tried with this test case</p>
  
  <pre><code>it('test remove button', () =&gt; {
    const test = shallow(&lt;removeButton/&gt;)
    const mockFunction = jest.fn()
    test.instance().remove = mockFunction
    test.find('Button').simulate('click')
    expect(mockFunction).toHaveBeenCalled()
  })
  </code></pre>
  
  <p>.instance().remove could not mock the function because it is out of scope.
  How would I mock the function remove ?</p>