Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No reducers getting wired, so can't test final state #157

Closed
SirCameron opened this issue Aug 30, 2018 · 2 comments
Closed

No reducers getting wired, so can't test final state #157

SirCameron opened this issue Aug 30, 2018 · 2 comments

Comments

@SirCameron
Copy link

Hey

So I'm not sure if I'm missing something, but from what I can see, one can't wire up the reducers in the same way you can with Redux. So, with this tool, you can only test what actions were fired, but you can't test the final state.

So to test final state, one needs to iterate through getActions() and pass each to the reducer being tested... why not simply include the ability to wire up reducers into the mock store?

then what's the point of getState() on the mockstore? it simply returns the initial state you set..

Please help me understand this?

@newyork-anthonyng
Copy link
Contributor

Hi @SirCameron,

The README says this, and mentions alternatives that might fit what you are looking for (see #71 for more info).

A mock store for testing Redux async action creators and middleware. The mock store will create an array of dispatched actions which serve as an action log for tests.

Please note that this library is designed to test the action-related logic, not the reducer-related one. In other words, it does not update the Redux store. If you want a complex test combining actions and reducers together, take a look at other libraries (e.g., redux-actions-assertions). Refer to issue #71 for more details.

@SirCameron
Copy link
Author

thanks @newyork-anthonyng ... I'll close this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants