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: {}}) }) })