You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/recipes/WritingTests.md
+52-14Lines changed: 52 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,9 @@ describe('actions', () => {
60
60
});
61
61
```
62
62
63
-
If you write async action creators
63
+
### Async Action Creators
64
+
65
+
For async action creators using [Redux Thunk](https://github.com/gaearon/redux-thunk) or other middleware, it’s best to completely mock the Redux store for tests. You can still use [`applyMiddleware()`](../api/applyMiddleware.md) with a mock store, as shown below. You can also use [nock](https://github.com/pgte/nock) to mock the HTTP requests.
0 commit comments