Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
eropple
8y ago
0 comments
Share
How do you test the code being run inside the Redux store? How do you mock your API client?
0 comments
default
newest
oldest
silversmith
8y ago
A thunk action `fetchData` would return a `(dispatch, getState) => {}` function. You call that with `getState` that would return your fixtures, and verify that `dispatch` gets called as expected. For API, I use jest and mock out imported functions.
j
/
k
navigate · click thread line to collapse