Skip to content

Commit d1a39b8

Browse files
committed
add null and undefined tests
1 parent 9714710 commit d1a39b8

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

test/1.basicTypes.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,12 @@ await describe('getObjectDifference() basic types', async () => {
158158
});
159159
});
160160
});
161+
await it('should compare undefined values', () => {
162+
const result = getObjectDifference(undefined, undefined);
163+
assert.strictEqual(result.length, 0, 'length of comparison results');
164+
});
165+
await it('should compare null values', () => {
166+
const result = getObjectDifference(null, null);
167+
assert.strictEqual(result.length, 0, 'length of comparison results');
168+
});
161169
});

test/1.basicTypes.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,16 @@ await describe('getObjectDifference() basic types', async () => {
210210
})
211211
})
212212
})
213+
214+
await it('should compare undefined values', () => {
215+
const result = getObjectDifference(undefined, undefined)
216+
217+
assert.strictEqual(result.length, 0, 'length of comparison results')
218+
})
219+
220+
await it('should compare null values', () => {
221+
const result = getObjectDifference(null, null)
222+
223+
assert.strictEqual(result.length, 0, 'length of comparison results')
224+
})
213225
})

0 commit comments

Comments
 (0)