title: testing callback return value with react-hooks-testing-library
body: <p>In this example we have a simple hook called <code>useLog</code> that returns a method. How do I test that it gets returned with react-hooks-testing-library. I am trying to figure out how to write the expect.</p>
  <p>The hooks useLog:</p>
  <pre><code>import {  useCallback } from 'react'
  export const useLog = () =&gt; {
    const log = useCallback(() =&gt; console.log(&quot;hello World&quot;), [])
    return { log }
  }
  </code></pre>
  <p>test:</p>
  <pre><code>import { renderHook } from '@testing-library/react-hooks'
  import {useLog} from &quot;./useCounter&quot;;
  
  const log = jest.fn()
  
  test('should return log metod', () =&gt; {
    const { result } = renderHook(() =&gt; useLog())
  
    expect(result.current.log).toHaveReturnedWith(log);
  })
  </code></pre>
  <p>what I get:</p>
  <pre><code>Matcher error: received value must be a mock function
  Received has type:  function
  Received has value: [Function anonymous]
  </code></pre>