title: Node 14 + Jest + ESM leads to maximum call stack size error. Before it was unexpected token error. How to fix?
body: <p>I have a backend project on Node js. Right now installed Node 14. So I have Jest and want to test functions from the <code>auth.js</code> file. So I create <code>auth.test.js</code> and <code>import login from '../auth.js</code> 0 got unexpected token error.</p>
  
  <p>Then I do the trick with <code>esm</code> according to the <a href="https://nodejs.org/api/esm.html#esm_enabling" rel="nofollow noreferrer">node documentation</a> </p>
  
  <p>So I hade <code>"type":module"</code> in my <code>package.json</code> file, but it didn't provide any result.
  So now I did this: </p>
  
  <pre><code>const esmImport = require('esm')(module);
  const login = esmImport('../src/controllers/auth')(module);
  test('Auth login', () =&gt; {
      let result = 'OK';
      expect(result).toBe('OK')
  })
  </code></pre>
  
  <p>And the error is: </p>
  
  <pre><code>
   FAIL  test/auth.test.js
    ● Test suite failed to run
  
      D:\Programming\Anami\anami-backend\node_modules\wkx\lib\point.js:1
      RangeError: Maximum call stack size exceeded
  </code></pre>
  
  <p>Any help how to fix this issue?</p>