Skip to content

Commit

Permalink
Add test on updating optional value
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegrift committed Jul 13, 2019
1 parent 36d051b commit 653194d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!
})
})

0 comments on commit 653194d

Please sign in to comment.