title: Mock a non-default function using Jest and React
body: <p>In a test file I need to render a component while mocking out some of its sub components. The file structure would look loosely something like this.</p>
  
  <p>File 1</p>
  
  <pre><code>import {A, B} from 'a-module';
  
  export function MyComponent() {
      return (
          &lt;div&gt;
              &lt;A /&gt; // I need to mock
              &lt;B /&gt; // these components out
          &lt;/div&gt;
      );
  }
  </code></pre>
  
  <p>File 2</p>
  
  <pre><code>import {MyComponent} from 'File 1';
  
  /*
   * In this file I would like to render MyComponent but
   * have components A and B be replaced by mocks
   */
  </code></pre>
  
  <p>I have tried doing <code>jest.mock('a-module', () =&gt; 'Blah');</code> but this is not successfully mocking the components. This works however when using default imports in File 1. </p>
  
  <p>Any help in mocking out components <code>A</code> and <code>B</code> when rendering <code>MyComponent</code> in file 2 would be most appreciated!</p>