From 0e5b27d76d31992f6e0e4440a936265c1f1e8171 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Thu, 7 Jul 2022 19:29:34 +0200 Subject: [PATCH] Add an extra test case to `removePathFromObject()` --- theatre/shared/src/utils/removePathFromObject.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/theatre/shared/src/utils/removePathFromObject.test.ts b/theatre/shared/src/utils/removePathFromObject.test.ts index 300ceba..191e9a1 100644 --- a/theatre/shared/src/utils/removePathFromObject.test.ts +++ b/theatre/shared/src/utils/removePathFromObject.test.ts @@ -32,5 +32,10 @@ describe(`removePathFromObject()`, () => { ) t({foo: 'foo'}, ['none'], {foo: 'foo'}) t({foo: 'foo'}, ['none', 'existing', 'prop'], {foo: 'foo'}) + + const foo = {one: {two: {three: 'three'}}} + removePathFromObject(foo.one, ['two', 'three']) + // make sure it doesn't delete above the base object + deepStrictEqual(foo, {one: {}}) }) })