Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
eropple
8y ago
0 comments
Save
Share
How do you test the code being run inside the Redux store? How do you mock your API client?
0 comments
1 comments · 1 top-level
top
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