Reducers

If there is anything to test within the Redux interactions, it is likely in the reducers. Reducers receive the actions and determine what to do, if anything, based on the actions requested and the data provided as part of those actions.

Typically, the reducer is going to simply call the API service once the appropriate service call is determined. It is possible that a reducer might also map the received data into a format that is more appropriate to the service call that must be made.

So, if the reducer is, in all reality, just going to call the service, what would we test for the reducer? Other than ensuring that the appropriate service method is called with the appropriate data there doesn't seem to be much. For completeness, we would want to test those things, but they do not represent the core of our business logic.

In conclusion, it doesn't appear that much is testable in Redux and what is testable doesn't represent the core of our business logic.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.102.142