title: SyntaxError: Cannot use import statement outside a module when following vue-test-utils official tutorial
body: <p>I can't get vue testing to work with vue-test-utils and jest. I created a clean new project with vue cli and added jest as follows, maybe someone can follow along and tell me what I'm doing wrong. (I'm following this installation guide: <a href="https://vue-test-utils.vuejs.org/installation/#semantic-versioning" rel="nofollow noreferrer">https://vue-test-utils.vuejs.org/installation/#semantic-versioning</a>)</p>
  <ol>
  <li><p><code>vue create jest-test</code></p>
  <p>1.1. <code>npm install</code></p>
  </li>
  <li><p><code>npm install --save-dev jest @vue/test-utils vue-jest</code></p>
  </li>
  <li><p>Added jest config to package.json:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;jest&quot;: {
      &quot;moduleFileExtensions&quot;: [
        &quot;js&quot;,
        &quot;json&quot;,
        &quot;vue&quot;
      ],
      &quot;transform&quot;: {
        &quot;.*\\.(vue)$&quot;: &quot;vue-jest&quot;
      }
    }
  }
  </code></pre>
  </li>
  <li><p><code>npm install --save-dev babel-jest @babel/core @babel/preset-env babel-core@^7.0.0-bridge.0</code></p>
  </li>
  <li><p>Adjusted jest config to:</p>
  <pre class="lang-js prettyprint-override"><code>{
    &quot;jest&quot;: {
      &quot;transform&quot;: {
        // process `*.js` files with `babel-jest`
        &quot;.*\\.(js)$&quot;: &quot;babel-jest&quot; //&lt;-- changed this
      }
    }
  }
  </code></pre>
  <ol start="6">
  <li>Adjusted babel config to:</li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>module.exports = {
      presets: [
          '@vue/cli-plugin-babel/preset',
          '@babel/preset-env' //&lt;-- added this
      ]
  };
  </code></pre>
  </li>
  <li><p>Created example.test.js in a tests directory under the project root (jest-test/tests)</p>
  </li>
  <li><p>Added the following to this file:</p>
  <pre class="lang-js prettyprint-override"><code>import { mount } from '@vue/test-utils'
  import HelloWorld from &quot;@/components/HelloWorld&quot;;
  
  
  test('displays message', () =&gt; {
      const wrapper = mount(HelloWorld)
  
      expect(wrapper.text()).toContain('Welcome to Your Vue.js App')
  })
  </code></pre>
  </li>
  <li><p>Added the following to the package.json scripts:
  <code>&quot;jest&quot;: &quot;jest&quot;</code></p>
  </li>
  <li><p><code>npm run jest</code></p>
  </li>
  <li><p>Get the following error:</p>
  <pre><code>C:\Users\xxx\jest-test\tests\example.test.js:1
      import { mount } from '@vue/test-utils'
      ^^^^^^
  
      SyntaxError: Cannot use import statement outside a module
  </code></pre>
  </li>
  </ol>
  <p>Same happens with Mocha or if I try it in an existing project. Is this a bug? I can't get it working, no matter what I do.</p>
  <p>Edit: If I do it with Vue CLI, it works
  <a href="https://vue-test-utils.vuejs.org/installation/#installation-with-vue-cli-recommended" rel="nofollow noreferrer">https://vue-test-utils.vuejs.org/installation/#installation-with-vue-cli-recommended</a></p>