Skip to content

Commit

Permalink
fix(lens): Update the lens to deal with broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Miller committed Oct 18, 2017
1 parent 5be1004 commit b677e4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lens.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ describe('with array', () => {
expect(deepLens.get(testObj)).toBe(2)
})
})
describe('with deep lens and object broken', () => {
const testObj = {}
describe('with deep lens and object that is broken', () => {
const testObj = undefined
const testLens = idLens<{
a: {
b: {
Expand All @@ -58,9 +58,9 @@ describe('with deep lens and object broken', () => {
const deepLens = testLens
.thenKey('a')
.thenKey('b')
.thenKey('c')
.thenKeyOr('c', 'f')

test('get a value deep', () => {
expect(deepLens.get(testObj as any)).toBe(undefined)
expect(deepLens.get(testObj as any)).toBe('f')
})
})

0 comments on commit b677e4e

Please sign in to comment.