title: TypeError: mxgraph is not a function When Running Jest Unit Tests
body: <p>I have a Vue JS Component That uses the <code>mxgraph</code> package:
  <a href="https://www.npmjs.com/package/mxgraph" rel="nofollow noreferrer">https://www.npmjs.com/package/mxgraph</a></p>
  <p>and imports it like this:</p>
  <pre class="lang-js prettyprint-override"><code>import * as mxgraph from 'mxgraph';
  
  const {
    mxClient,
    mxStackLayout,
    mxGraph,
    mxRubberband,
    mxUtils,
    mxFastOrganicLayout,
    mxSwimlaneLayout,
    mxEvent,
    mxGraphModel,
    mxConstants,
    mxHierarchicalLayout,
    mxSwimlaneManager
  } = mxgraph();
  // noinspection TypeScriptCheckImport
  import {
    mxConstants as MxConstants
  } from 'mxgraph/javascript/mxClient.js'
  import axios from 'axios';
  </code></pre>
  <p>This is my jest.config.js</p>
  <pre><code>module.exports = {
    preset: &quot;@vue/cli-plugin-unit-jest/presets/no-babel&quot;,
    moduleFileExtensions: [&quot;js&quot;, &quot;ts&quot;, &quot;json&quot;, &quot;vue&quot;],
    transform: {
      &quot;.*\\.(vue)$&quot;: &quot;vue-jest&quot;,
      &quot;^.+\\.tsx?$&quot;: &quot;ts-jest&quot;
    },
    globals: {
      &quot;ts-jest&quot;: {
        tsConfig: &quot;src/tsconfig.json&quot;
      }
    }
  };
  </code></pre>
  <p>When I run my tests I get:</p>
  <pre><code>TypeError: mxgraph is not a function
  
    20 |   import * as mxgraph from 'mxgraph';
    21 | 
  &gt; 22 |   const {
       | ^
    23 |     mxClient,
    24 |     mxStackLayout,
    25 |     mxGraph,
  
    at src/components/task/job/job_pipeline_mxgraph.vue:22:1
    at Object.&lt;anonymous&gt; (src/components/task/job/job_pipeline_mxgraph.vue:568:3)
    at src/components/task/job/task_template_wizard_creation/step_attach_directories_task_template.vue:67:1
    at Object.&lt;anonymous&gt; (src/components/task/job/task_template_wizard_creation/step_attach_directories_task_template.vue:367:3)
    at Object.&lt;anonymous&gt; (tests/unit/task/job/task_template_wizard_creation/step_attach_directories_task_template.spec.js:3:1)
  </code></pre>
  <p>The import works fine when I run my app using my normal webpack configurations files. Is there anything I need to add to my jest.config to fix this error?</p>