title: Trouble mocking ES6 Module using jest.unstable_mockModule
body: <p>I'm attempting to mock a call to a class instance function on an ES6 module being imported by the code under test. I've followed the progress of the ES6 support and eventually stumbled onto this PR <a href="https://github.com/facebook/jest/pull/10976" rel="noreferrer">https://github.com/facebook/jest/pull/10976</a> which mentioned that in 27.1.1 support for jest.unstable_mockModule was added. I upgraded my version of Jest to take advantage and while the test doesn't error, it also doesn't seem to actually mock the module either.</p>
  <p>This is the module under test:</p>
  <pre class="lang-js prettyprint-override"><code>// src/Main.mjs
  
  import Responder from './Responder.mjs'
  import Notifier from './Notifier.mjs'
  
  export default {
    async fetch(request, environment, context) {
      let response
  
      try {
        response = new Responder(request, environment, context).respond()
      } catch (error) {
        return new Notifier().notify(error)
      }
  
      return response
    }
  }
  </code></pre>
  <p>Here is the test:</p>
  <pre class="lang-js prettyprint-override"><code>// test/Main.test.mjs
  
  import { jest } from '@jest/globals'
  import main from '../src/Main.mjs'
  
  describe('fetch', () =&gt; {
    test('Notifies on error', async () =&gt; {
      const mockNotify = jest.fn();
      
      jest.unstable_mockModule('../src/Notifier.mjs', () =&gt; ({
        notify: mockNotify
      }))
  
      const notifierMock = await import('../src/Notifier.mjs');
      
      await main.fetch(null, null, null)
  
      expect(mockNotify).toHaveBeenCalled()
    })
  })
  </code></pre>
  <p>I'm trying to mock the call to Notify to expect it to have been called and while this will run, it raises an exception from inside the <code>Notifier.notify()</code> that is supposed to be mocked, so it appears that it isn't being mocked at all.</p>
  <p>What am I missing? Any help is much appreciated. </p>