mardi 24 avril 2018

Vue js unit testing UNEXPECTED TOKEN

I am trying to test my Vue js project by making unit tests. I ran the default setup. This means my test runner is Jest.

Default when you initialize a project, and say "yes" to generate unit tests with Jest, it makes a HelloWorld component along with tests for this component. This is what I did.

Now I want to test my custom component, but it keeps saying that there is an unexpected token at line 1. Which is the HTML element.

I will provide some links down below here to share the code:

Code of HelloWorld.vue 
https://pastebin.com/tdkZ3drD

Code of HelloWorld.spec.js
https://pastebin.com/cZvNPYyi

Code of Map.vue (My custom component)
https://pastebin.com/VytGyzZy

Code of Map.spec.js
https://pastebin.com/7NmjgCrs

Below here I will list some screenshots of the test results:

Test result page 1 Test result page 2

Last thing I will provide is the detailed error log:

Link to detailed error log: 
https://pastebin.com/PKrMsbqC

Please let me know if you can help me with this problem :)

Thanks

Aucun commentaire:

Enregistrer un commentaire