title: Mock out imported Lazy React component
body: <p>Here's my lazy component:</p>
  
  <pre><code>const LazyBones = React.lazy(() =&gt; import('@graveyard/Bones')
    .then(module =&gt; ({default: module.BonesComponent}))
  export default LazyBones
  </code></pre>
  
  <p>I'm importing it like this:</p>
  
  <pre><code>import Bones from './LazyBones'
  
  export default () =&gt; (
  &lt;Suspense fallback={&lt;p&gt;Loading bones&lt;/p&gt;}&gt;
    &lt;Bones /&gt;
  &lt;/Suspense&gt;
  )
  </code></pre>
  
  <p>And in my test I have this kind of thing:</p>
  
  <pre><code>import * as LazyBones from './LazyBones';
  
  describe('&lt;BoneYard /&gt;', function() {
    let Bones;
    let wrapper;
    beforeEach(function() {
      Bones = sinon.stub(LazyBones, 'default');
      Bones.returns(() =&gt; (&lt;div /&gt;));
      wrapper = shallow(&lt;BoneYard /&gt;);
    });
    afterEach(function() {
      Bones.restore();
    });
  
    it('renders bones', function() {
      console.log(wrapper)
      expect(wrapper.exists(Bones)).to.equal(true);
    })
  
  })
  </code></pre>
  
  <p>What I expect is for the test to pass, and the console.log to print out:</p>
  
  <pre><code>&lt;Suspense fallback={{...}}&gt;
    &lt;Bones /&gt;
  &lt;/Suspense&gt;
  </code></pre>
  
  <p>But instead of <code>&lt;Bones /&gt;</code> I get <code>&lt;lazy /&gt;</code> and it fails the test.</p>
  
  <p>How can I mock out the imported Lazy React component, so that my simplistic test passes?</p>