Closed gmlewis closed 3 years ago
I believe I found a workaround. It turns out that createStore
in the unit test framework is being called on store
which had already been created with createStore
.
So I changed my store's definition to this:
// exported for testing purposes.
export const testStore = {
state,
mutations,
actions,
getters,
}
export const store = createStore(testStore)
and in the unit tests I do this:
import { testStore as store } from '@/store'
and now things are working.
Hi @Duncank - I bought your book and am trying to write my own tests in my own Vue3 app, but keep running into the same issue. A Google search isn't helping much. Do you have any ideas on how to fix this?
The error is:
Store looks like:
And 'getters' looks like:
My "package.json" looks like: