title: Manual mock React-Intl with Jest to have snapshot testing
body: <p>I have been struggling mocking <a href="https://github.com/yahoo/react-intl" rel="noreferrer">React-Intl library</a> with <a href="https://facebook.github.io/jest/docs/manual-mocks.html" rel="noreferrer">Jest</a> because I'm having this error when I run tests:</p>
  
  <pre><code>Invariant Violation: [React Intl] Could not find required `intl` object. &lt;IntlProvider&gt; needs to exist in the component ancestry.
  </code></pre>
  
  <p>The <a href="https://github.com/yahoo/react-intl/wiki/Testing-with-React-Intl#jest-mock" rel="noreferrer">documentation</a> of this library says that we have to create a folder in root project called <code>__Mocks__</code> and then add this file:</p>
  
  <pre><code>// ./__mocks__/react-intl.js
  import React from 'react';
  const Intl = require.requireActual('react-intl');
  
  // Here goes intl context injected into component, feel free to extend
  const intl = {
    formatMessage: ({defaultMessage}) =&gt; defaultMessage
  };
  
  Intl.injectIntl = (Node) =&gt; (props) =&gt; &lt;Node {...props} intl={intl}/&gt;;
  
  module.exports = Intl;
  </code></pre>
  
  <p>But nothing happens.</p>