title: Vue vue-sweetalert2 . error in test:unit with Jest
body: <p>As per the <a href="https://github.com/avil13/vue-sweetalert2" rel="nofollow noreferrer">vue-sweetalert2</a> doc, in my <code>main.js</code>, I import and use the plugin:</p>
  
  <pre><code>import VueSweetalert2 from "vue-sweetalert2";
  Vue.use(VueSweetalert2);
  </code></pre>
  
  <p>In my component, <code>ContactForm.vue</code>, I can use:</p>
  
  <pre><code>this.$swal(...)
  </code></pre>
  
  <p>However, when I test:unit this component, I need to add the import and <code>Vue.use()</code></p>
  
  <pre><code> import VueSweetalert2 from "vue-sweetalert2";
   Vue.use(VueSweetalert2);
  </code></pre>
  
  <p>and I get an error:</p>
  
  <pre><code>$ vue-cli-service test:unit ContactForm.spec.js
  </code></pre>
  
  <p>FAIL  tests/unit/ContactForm.spec.js
    ● Test suite failed to run</p>
  
  <pre><code>Jest encountered an unexpected token
  
  This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
  
  By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
  
  Here's what you can do:
   • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
   • If you need a custom transformation specify a "transform" option in your config.
   • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
  
  You'll find more details and examples of these config options in the docs:
  https://jestjs.io/docs/en/configuration.html
  
  Details:
  
  /Users/yves/Developments/WIP/VUE.JS-cli-3/3-chocha-home-content/chocha/node_modules/vue-sweetalert2/src/index.js:2
  import swal from 'sweetalert2/dist/sweetalert2.min.js';
  ^^^^^^
  
  SyntaxError: Unexpected token import
  </code></pre>
  
  <p>What could be wrong?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>the <code>vue-sweetalert2/src/index.js</code>, line 2 faulty line, is:</p>
  
  <pre><code>// @ts-check
  import swal from 'sweetalert2/dist/sweetalert2.min.js';
  </code></pre>
  
  <p>the developer of this wrapper added an <code>index.d.ts</code> fie</p>
  
  <pre><code>import Vue, { PluginObject, PluginFunction } from 'vue';
  import * as swal from 'sweetalert2';
  ...
  </code></pre>
  
  <p>but it seems not to be taken in account.</p>