...

/

Basic Reducer Test

Basic Reducer Test

Build a basic code to test the reducers.

We'll cover the following...

Testing reducers is similar to testing action creators because reducers are idempotent. This means that it will return the same new state every time given a state and an action. This makes reducer tests very easy to write, as we simply need to call the reducer with different combinations of input to verify the correctness of the output.

Basic reducer test

For our test, we can create a very crude reducer that handles a single ADD_RECIPE action and whose state is simply an ...