From de2adffe9caa3e3899abe4c3e42c7c787f741fc8 Mon Sep 17 00:00:00 2001 From: nlepage <19571875+nlepage@users.noreply.github.com> Date: Sun, 12 Nov 2017 23:57:30 +0100 Subject: [PATCH] :white_check_mark: Test out of bound slice --- src/core/apply.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/core/apply.spec.js b/src/core/apply.spec.js index 0fffc567..5df139cc 100644 --- a/src/core/apply.spec.js +++ b/src/core/apply.spec.js @@ -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', + ) })