miracoly
Mocking Pinia Store in Vitest Component Test
I would like to test my Nuxt3 component with vitest and nuxt/test-utils. This component uses a Pinia store.
Component (simplified):
Store (simplified):
I've now tried to test it as described on the Pina page about testing.
Test:
Both assertions fail, the first one with
AssertionError: expected "spy" to be called once, but got 0 times
. Its like my component does not pick up the testing Pinia instance for some reason.2 replies