Add an extra test case to removePathFromObject()

This commit is contained in:
Aria Minaei 2022-07-07 19:29:34 +02:00 committed by Aria
parent ebf2a19900
commit 0e5b27d76d

View file

@ -32,5 +32,10 @@ describe(`removePathFromObject()`, () => {
) )
t({foo: 'foo'}, ['none'], {foo: 'foo'}) t({foo: 'foo'}, ['none'], {foo: 'foo'})
t({foo: 'foo'}, ['none', 'existing', 'prop'], {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: {}})
}) })
}) })