Questions tagged [vue-jest]
26 questions
28
votes
4 answers
TypeError: Cannot read properties of undefined (reading 'html')
I am trying to introduce Jest to my current project.
However, during the initial setup, I encountered this error and it is not running properly.
How can I solve this?
I am currently using vue2 from vue-cli.
● Test suite failed to run
TypeError:…

김정수
- 611
- 4
- 9
- 22
8
votes
2 answers
jest ReferenceError: Vue is not defined
We are introducing Jest to an existing project.
However, I wrote an example test code.
The above error occurred.
ReferenceError: Vue is not defined
1 | import User from "../components/modal/ad/AdAdd";
> 2 | import { mount } from…

김정수
- 611
- 4
- 9
- 22
5
votes
3 answers
How do I use Vue3 with vue-jest?
I have the following dependency...
"vue-jest": "latest",
But when I run npm install I get...
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: vue@3.1.4
npm WARN node_modules/vue
npm WARN vue@"latest" from the root project
npm WARN 7…

Jose Gleeson
- 173
- 1
- 11
4
votes
1 answer
TypeError: Unable to require `.d.ts` file
Stack
vue 3.2.19
@vue/test-utils 2.0.0-rc.15
typescript 4.1.6
Problem
I have a problem when running the command vue-cli-service test:unit --no-cache.
Please check TypeError
(link to CI…

Baronkoko
- 61
- 4
3
votes
1 answer
vue-jest related: Cannot find module 'vue' from
folder structure
As it shows in the picture, I have two projects that share some vue components.
I import ImageBlock.vue in my Card.vue component, it works fine. But when I write test cases for Card component, I got the error
> Cannot find module…

themoonpie
- 31
- 3
2
votes
0 answers
How test JSX Vue3 component with Jest
How to pass the Jest test using render and JSX writing in Vue files?
Can you guys help to see?
Vue file use typescript & render: button.vue(code)