Search code examples
vue.jsjestjsvuejs3vue-jest

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 more (@headlessui/vue, @heroicons/vue, @vue/compiler-sfc, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer vue@"^2.x" from vue-jest@3.0.7
npm WARN node_modules/vue-jest
npm WARN   dev vue-jest@"latest" from the root project

I looked at the code and I see a lib called vue3-jest but that isn't available in npm...

What is the proper way to get the version of vue-jest that uses vue3?


Solution

  • since jest v27,use vue3-jest instead.

    npm i vue3-jest
    

    feat: support jest v27 in vue3-jest #343