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
Can u please let me know how to write test cases for async actions created using redux promise middlware which is making an http request.
I am trying to use redux mock store and sinon.js for mocking but facing issues,
TypeError: dispatch(...).then is not a function when i try to call a action creator
return dispatch => {
// show progress bar
return dispatch({
type: projectActionsType,
payload: post(wsConst.baseURL + wsConst.save, {
un:'abc',
pw:123
})
}).then(() => {
//hide progress bar
});
};
How can i write test case for same with response Fulfilled, rejected and pending
Please let know how can i mock my requests and write testcases for same
Thanks for any help
The text was updated successfully, but these errors were encountered:
@poornimabs This isn't an issue related to the middleware; you are asking for examples on how to write tests for async actions (in general). Considering this is outside the scope of this project and you don't provide useful information in the issue, I won't be able to provide any help for you, sorry.
In the future, consider what you are asking when you create an issue on GitHub. I (and other OSS maintainers/contributors) prefer issues related to reproducible bugs, useful improvements, feature requests or questions which benefit the community. You should not expect me to show you how to code something from scratch. Addtionally, you should format your issues to be clear and easy to understand. I'm not going to cipher through a poorly formatted issue.
Hi,
Can u please let me know how to write test cases for async actions created using redux promise middlware which is making an http request.
I am trying to use redux mock store and sinon.js for mocking but facing issues,
TypeError: dispatch(...).then is not a function when i try to call a action creator
return dispatch => {
// show progress bar
return dispatch({
type: projectActionsType,
payload: post(wsConst.baseURL + wsConst.save, {
un:'abc',
pw:123
})
}).then(() => {
//hide progress bar
});
};
How can i write test case for same with response Fulfilled, rejected and pending
Please let know how can i mock my requests and write testcases for same
Thanks for any help
The text was updated successfully, but these errors were encountered: