title: mock for react-intl with using useIntl
body: <p>I'm using useIntl hook in my component. In my test I mock useIntl in file react-intl.js in src/<strong>mocks</strong> directory. Also in this file, I mock defineMessages, that are used in many other components.</p>
  
  <p>The part of mock with defineMessages in src/<strong>mocks</strong>/react-intl.js looks like</p>
  
  <pre><code>export const defineMessages = jest.fn(() =&gt; ({
    defineMessages: jest.fn((...args) =&gt; JSON.stringify(args))
  }));
  </code></pre>
  
  <p>The mock of useIntl looks the same, it works.</p>
  
  <p>The problem is when I start the tests, I get undefined in places where I use defineMessages. Where is the error?</p>