...

/

Making the Tests Pretty

Making the Tests Pretty

Write the code in a presentable way.

Now that we’ve solved all the functionality issues, we can use the same tricks we used in the action creator tests to simplify our reducer tests. Here are the original tests:

it('should add recipe to empty list', () => {
  const action = { type: ADD_RECIPE, payload: 'test' };
  const expected = [{ title: "test" }];

  expect(reducer(initialState, action)).toEqual(expected);
});
...