From 63acd5d170609c672a9d47b06be7015722eb11fe Mon Sep 17 00:00:00 2001 From: zeezephyr <142696453+zeezephyr@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:58:46 -0500 Subject: [PATCH] Remove default value from counterReducer Remove initialState default value in the counterReducer so that this test fails: ``` test("should return a proper initial state when called with undefined state", () => { const state = {}; const action = { type: "DO_NOTHING", }; const newState = counterReducer(undefined, action); expect(newState).toEqual(initialState); }); ``` From reading the exercise it seems like the intent is to have the student fix the reducer so the test passes. As it is currently written the test passes without any changes. --- src/reducer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reducer.js b/src/reducer.js index 4f68882e..af802330 100644 --- a/src/reducer.js +++ b/src/reducer.js @@ -4,7 +4,7 @@ const initialState = { bad: 0 } -const counterReducer = (state = initialState, action) => { +const counterReducer = (state, action) => { console.log(action) switch (action.type) { case 'GOOD':