Because Redux reducers and action creators are just functions, and actions are simply objects, they are easy to test. Furthermore, many of those functions are pure, which means they have no side effects. Pure functions only use their arguments and constants to produce the output. This is why we only need to pass certain arguments and check the output to test the function. If there are side effects involved (which is the case for asynchronous action creators), we need to do some mocking.
Testing Redux
Synchronous action creators
We start by writing tests for our synchronous action creators. Remember: action creators are functions which return action objects. To test them, we need to call the action creator and check if it returns...