Pinia error with Vue 2.7.x and jest #1796
Replies: 4 comments 1 reply
-
You need to upgrade your Vue-Demi version. With npm, npm upgrade should do. You can also reinstall Vue-demi@latest |
Beta Was this translation helpful? Give feedback.
-
I'm running into the same issue, and have yet to find a solution. Vue 2.7.14, Pinia 2.0.27, Jest 29.3.1. Tried installing [email protected] and it didn't help. Tried |
Beta Was this translation helpful? Give feedback.
-
@posva Do you have any other suggestions on how to solve this? 🙏 |
Beta Was this translation helpful? Give feedback.
-
Having the same issue in 2024. Calling createTestingPinia() throws the error: |
Beta Was this translation helpful? Give feedback.
-
Reproduction
See reproduction steps
Steps to reproduce the bug
I've used pinia with vue 2.7.x, and it's worked fine up until I try to write some unit tests for my store and components. I'm utilizing the latest versions of vue 2 (v2.7.14), pinia (v2.0.23), and jest (v29.3.1).
When I run my unit tests I get the following error:
vueDemi.effectScope is not a function
Store test file:
It appears that the error occurs when
createPinia()
is called. I see a similar error when writing unit tests for vue components usingcreateTestingPinia()
from@pinia/testing
.As best as I can tell, I believe this is a bug within pinia.
Expected behavior
Should be able to run unit tests utilizing pinia, vue 2.7.x, and jest.
Actual behavior
Getting an error stating that
vueDemi.effectScope is not a function
.Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions