Actions are undefined in tests #2464
-
Hello everyone, I'm not sure I'm in the right section for this, but I'm still not sure if it's a bug or just an obvious mistake from my side. I'm trying to test a component where an action is a store is used in a writable computed
In my test, I think that I have done everything as needed, but I always get this error:
After some debugging, it seems that all the actions of my userStore are undefined. The value of What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Your createSpy: vi.fn, I improved the docs at 40f8f22 |
Beta Was this translation helpful? Give feedback.
Your
createSpy
option is not correct See https://pinia.vuejs.org/cookbook/testing.html#Testing-stores:I improved the docs at 40f8f22