Skip to content

Commit f8ccc9f

Browse files
committed
Merge pull request reduxjs#1549 from ro-savage/docs-tests-async-actions-update
Update docs - Writing tests - Async actions text example
2 parents 64a8c66 + e57bf27 commit f8ccc9f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

docs/recipes/WritingTests.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,11 @@ describe('async actions', () => {
134134
const store = mockStore({ todos: [] })
135135

136136
store.dispatch(actions.fetchTodos())
137-
.then(() => {
138-
const actions = store.getActions()
139-
140-
expect(actions[0].type).toEqual(types.FETCH_TODOS_REQUEST)
141-
142-
done()
137+
.then(() => { // return of async actions
138+
expect(store.getActions()).toEqual(expectedActions)
143139
})
140+
.then(done) // test passed
141+
.catch(done) // test failed
144142
})
145143
})
146144
```

0 commit comments

Comments
 (0)