From 653194d01b5b91ed73e1191ef4659a3c7f3d6403 Mon Sep 17 00:00:00 2001 From: Emanuel Tesar Date: Sat, 13 Jul 2019 15:46:04 +0200 Subject: [PATCH] Add test on updating optional value --- src/test/update.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/update.test.ts b/src/test/update.test.ts index 43fd050..23ed1a8 100644 --- a/src/test/update.test.ts +++ b/src/test/update.test.ts @@ -133,4 +133,9 @@ describe('update', () => { }) }) }) + + test('optional path', () => { + const newState = update(state, ['optional', 'a'], (op) => 123) + expect(newState.optional.a).toBe(123) // the path surely exists now! + }) })