We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d367e7 commit 0838b8dCopy full SHA for 0838b8d
src/__tests__/vuex.js
@@ -1,5 +1,6 @@
1
import '@testing-library/jest-dom'
2
import {render, fireEvent} from '@testing-library/vue'
3
+import Vue from 'vue'
4
import Vuex from 'vuex'
5
6
import VuexTest from './components/Store/VuexTest'
@@ -57,6 +58,12 @@ test('can render with vuex with custom store', async () => {
57
58
})
59
60
test('can render with an instantiated Vuex store', async () => {
61
+ // Before calling new Vuex.Store in your code, you'll need to `.use` it on the
62
+ // global (or local) Vue instance. In frameworks like Jest, the `setupFilesAfterEnv`
63
+ // property is a good place to do this.
64
+ // https://jestjs.io/docs/configuration#setupfilesafterenv-array
65
+ Vue.use(Vuex)
66
+
67
const {getByTestId, getByText} = render(VuexTest, {
68
store: new Vuex.Store({
69
state: {count: 3},
0 commit comments