You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and this is how I provide the mock store, following the docs
const store = new Store({ state, getters }); config.global.mocks.$store = store;
But I'm stuck with
multiple [Vue warn]: injection "store" not found.
Now, my question is, is there a function like injectRouterMock in vue-router-mock which can be used or how do I provide the injection (useStore uses injection internally, I think)
I tried the provide option on global but with no luck, maybe I'm missing something?
PS. it was working with the following implementation,
const store = createStore({ modules: { site,... } }) config.global.plugins = [store] config.global.provide = { [Symbol('mock-store')]: store }
The text was updated successfully, but these errors were encountered:
All my components use store like so,
const store = useStore();
in my
jest.setup.js
I have,const state = { site: { id: 1, }, post: { data: [], },...
const getters = { 'site/getSite': { id: 1, created: null,...
and this is how I provide the mock store, following the docs
const store = new Store({ state, getters });
config.global.mocks.$store = store;
But I'm stuck with
multiple
[Vue warn]: injection "store" not found.
Now, my question is, is there a function like
injectRouterMock
invue-router-mock
which can be used or how do I provide the injection (useStore uses injection internally, I think)I tried the provide option on global but with no luck, maybe I'm missing something?
PS. it was working with the following implementation,
const store = createStore({ modules: { site,... } })
config.global.plugins = [store]
config.global.provide = { [Symbol('mock-store')]: store }
The text was updated successfully, but these errors were encountered: