In my React-redux
app, one of my action creators returns
like this:
return {
type : GET_RESULTS,
payload: response
};
I am trying to write a test where I just call the action creator externally and mock its arguments since its just a pure function.
In my app, the middleware redux-promise
directly handles the promise to payload conversion in the store and passes it to the reducers.
The issue is that, the payload
in the above returned object is a promise
returned by axios GET
call. So, in my test file, where I call it, I will get a promise
, but I need to get its real payload value, the one after the promise
is complete.
How do I do this?