File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 11import '@testing-library/jest-dom'
22import { render , fireEvent } from '@testing-library/vue'
3+ import Vue from 'vue'
34import Vuex from 'vuex'
45
56import VuexTest from './components/Store/VuexTest'
@@ -57,6 +58,12 @@ test('can render with vuex with custom store', async () => {
5758} )
5859
5960test ( '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+
6067 const { getByTestId, getByText} = render ( VuexTest , {
6168 store : new Vuex . Store ( {
6269 state : { count : 3 } ,
You can’t perform that action at this time.
0 commit comments