Skip to content

Commit 77f2b35

Browse files
committed
fix all tests
1 parent 1668bd6 commit 77f2b35

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

test/test.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ describe('Vuex', () => {
183183
state: {
184184
a: 1
185185
},
186-
actions: {
187-
test: TEST
188-
},
189186
mutations: {
190187
[TEST] (state, n) {
191188
state.a += n
@@ -204,7 +201,7 @@ describe('Vuex', () => {
204201
]
205202
})
206203
expect(initState).to.equal(store.state)
207-
store.actions.test(2)
204+
store.dispatch(TEST, 2)
208205
expect(mutations.length).to.equal(1)
209206
expect(mutations[0].type).to.equal(TEST)
210207
expect(mutations[0].payload[0]).to.equal(2)
@@ -217,9 +214,6 @@ describe('Vuex', () => {
217214
state: {
218215
a: 1
219216
},
220-
actions: {
221-
test: TEST
222-
},
223217
mutations: {
224218
[TEST] (state, n) {
225219
state.a += n
@@ -243,7 +237,7 @@ describe('Vuex', () => {
243237
})
244238
expect(initState).not.to.equal(store.state)
245239
expect(initState.a).to.equal(1)
246-
store.actions.test(2)
240+
store.dispatch(TEST, 2)
247241
expect(mutations.length).to.equal(1)
248242
expect(mutations[0].mutation.type).to.equal(TEST)
249243
expect(mutations[0].mutation.payload[0]).to.equal(2)
@@ -257,15 +251,10 @@ describe('Vuex', () => {
257251
state: {
258252
a: 1
259253
},
260-
actions: {
261-
test: ({ dispatch, state }) => {
262-
state.a++
263-
}
264-
},
265254
strict: true
266255
})
267256
expect(() => {
268-
store.actions.test(2)
257+
store.state.a++
269258
}).to.throw(/Do not mutate vuex store state outside mutation handlers/)
270259
})
271260
})

0 commit comments

Comments
 (0)