Skip to content
This repository was archived by the owner on Feb 3, 2020. It is now read-only.

Commit c8ab76d

Browse files
committed
test: add coverage for default state
1 parent ee82164 commit c8ab76d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/handle-action.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,12 @@ test('handles specific action and uses previous state if directly return value i
6464
expect(newState1).toEqual({ baz: 0 });
6565
expect(newState1).toBe(state);
6666
});
67+
68+
test('supports default state', () => {
69+
const ac1 = createAction<void>('foo6');
70+
const state: { readonly baz: number } = { baz: 0 };
71+
const re = handleAction<typeof state>(ac1, () => undefined, state);
72+
const newState1 = re(undefined, { type: '@@redux/INIT' });
73+
expect(newState1).toEqual({ baz: 0 });
74+
expect(newState1).toBe(state);
75+
});

0 commit comments

Comments
 (0)