Skip to content

Commit

Permalink
✅ Test out of bound slice
Browse files Browse the repository at this point in the history
  • Loading branch information
nlepage committed Nov 13, 2017
1 parent 5aae427 commit ddf4c50
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/core/apply.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,21 @@ describe('Apply', () => {
)
})

immutaTest(
input => {
const output = inc(input, 'nested.prop[3:5].val', 6)
expect(output).toEqual({
nested: { prop: [{ val: 0 }, { val: 1 }, undefined, { val: 6 }, { val: 6 }] },
other: {},
})
return output
},
{
nested: { prop: [{ val: 0 }, { val: 1 }] },
other: {},
},
'nested.prop.2',
'nested.prop.3.val',
'nested.prop.4.val',
)
})

0 comments on commit ddf4c50

Please sign in to comment.