Update snippet, add extra tests
This commit is contained in:
@ -10,7 +10,8 @@ const data = {
|
||||
d: {},
|
||||
e: { a: 'a', b: 'b', c: 'c', d: ['a', 'b', 'c'] },
|
||||
f: 1,
|
||||
g: true
|
||||
g: true,
|
||||
h: null
|
||||
};
|
||||
const dupe = deepClone(data);
|
||||
test('Shallow cloning works', () => {
|
||||
@ -33,3 +34,6 @@ test('Cloning primitives works', () => {
|
||||
expect(data.f).toBe(dupe.f);
|
||||
expect(data.g).toBe(dupe.g);
|
||||
});
|
||||
test('Cloning null works', () => {
|
||||
expect(data.h).toBe(dupe.h);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user