title: Jest, ES6 modules "does not provide export named"
body: <p>I have an express app with a CRUD API (with sequelize) and I want to test it with Jest. I'm pretty new in unit-testing so I follow this <a href="https://www.albertgao.xyz/2017/05/24/how-to-test-expressjs-with-jest-and-supertest/" rel="nofollow noreferrer">guide</a>, recommended by <a href="https://jestjs.io/docs/testing-frameworks#expressjs" rel="nofollow noreferrer">Jest's website</a>.</p>
  <p>The problem I have is that my app is built with ES6 modules and Jest ES6 modules is experimental and it seems that it doesn't &quot;import&quot; packages.</p>
  <p>I have this test <em>(took from the guide)</em></p>
  <pre class="lang-js prettyprint-override"><code>import request from 'supertest';
  import app from '../app';
  
  describe('Test the root path', () =&gt; {
      test('It should response the GET method', done =&gt; {
          request(app)
              .get('/')
              .then(response =&gt; {
                  expect(response.statusCode).toBe(404);
                  done();
              });
      });
  });
  </code></pre>
  <p>And when I launched it (with <code>NODE_OPTIONS=--experimental-vm-modules npx jest</code> I had to follow this <a href="https://jestjs.io/docs/ecmascript-modules" rel="nofollow noreferrer">jest wiki page</a>), It says that</p>
  <p><code>'sequelize' does not provide an export named 'DataTypes'</code> and when I launch my app normally (like with <code>npm start</code>) it works fine, without any problems.</p>
  <p><em>(the complete error log):</em></p>
  <pre><code>(node:49576) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
  (Use `node --trace-warnings ...` to show where the warning was created)
   FAIL  __tests__/app_test.js
    ● Test suite failed to run
  
      SyntaxError: The requested module 'sequelize' does not provide an export named 'DataTypes'
  
        at Runtime.linkAndEvaluateModule (node_modules/jest-runtime/build/index.js:779:5)
        at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
        at runJest (node_modules/@jest/core/build/runJest.js:404:19)
        at _run10000 (node_modules/@jest/core/build/cli/index.js:320:7)
        at runCLI (node_modules/@jest/core/build/cli/index.js:173:3)
  </code></pre>
  <p><em>(and my Jest config)</em></p>
  <pre><code>// Sync object
  /** @type {import('@jest/types').Config.InitialOptions} */
  
  export default async () =&gt; {
      return {
          verbose: true,
          transform: {},
      };
  };
  </code></pre>
  <p>Am I doing something wrong ? Should I change to commonJS instead of ES6</p>
  <p>Thank you.</p>