You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[vue-jest] Error: Vuetemplatecompilationfailed1|import{ shallowMount }from'@vue/test-utils'>2|importProblemfrom'./../../src/components/Problem.vue'|^3|4|describe('Problem.vue',()=>{5|it('initializes and sets up correctly',()=>{aterror(node_modules/vue-jest/lib/throw-error.js:2:9)atObject.<anonymous>(tests/unit/problem.spec.js:2:1)
This was my mistake as it was almost impossible for me to see, but there were two class attributes on one dom element and the compiler was correctly telling me this was wrong. Two things that are still confusing:
Why did vue-jest not tell me where the error was? That is a possible improvement and would have saved a lot of time. Instead it just told me the import statement was where the error was.
Why does the production vue-template-compiler compile this without warnings or errors?
Thanks
eddyerburgh
changed the title
[vue-jest] Error: Vue template compilation failed
[vue-jest] Improve error handling
Feb 8, 2019
eddyerburgh
changed the title
[vue-jest] Improve error handling
Improve error handling
Feb 8, 2019
Here is the error I'm getting:
Please see this git repo for reproduction:
https://github.com/sktzofrenic/jest-problem
run
$ cd hello-world
$ npm run test:unit
This is basically a vanilla vue-cli project with one added component that is generating this issue.
I cannot figure out what won't compile about this template.
When I build for production it compiles just fine and this component works on the live site. I just can't test it for some reason.
I would appreciate any assistance. Thank you!
The text was updated successfully, but these errors were encountered: