Add an extra test case to removePathFromObject()
This commit is contained in:
parent
ebf2a19900
commit
0e5b27d76d
1 changed files with 5 additions and 0 deletions
|
@ -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: {}})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue