I followed this tutorial https://frontstuff.io/build-your-first-vue-js-component to build a vue js component. I then followed this tutorial https://frontstuff.io/unit-test-your-first-vuejs-component to unit test the component. The unit test fails at the import statement on the component and returns this error:
● Test suite failed to run
C:\Users\SHINIGAMI-ALFSABAH\Documents\Workspace\Dev\Vue\star-rating\node_modules\vue-awesome\icons\star.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import Icon from '../components/Icon.vue'
^^^^^^
SyntaxError: Cannot use import statement outside a module
12 |
13 | <script>
> 14 | import 'vue-awesome/icons/star'
| ^
15 | import Icon from 'vue-awesome/components/Icon'
16 |
17 | export default {
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)
at src/components/Rating.vue:14:1
at Object.<anonymous> (src/components/Rating.vue:67:3)
Any help will be appreciated.