UNPKG

multimediaobject

Version:
28 lines (26 loc) 867 B
describe('utils.isEmpty', () => { const testEmptyObject = {}; const testFullObject = { accessKey: '', assignedSlot: null, }; const testCreatedNewObject = Object.create({}); it('should return true if object is empty', () => { expect(utils.isEmpty(testEmptyObject)).toBe(true); }); it('should return false if object is not empty', () => { expect(utils.isEmpty(testFullObject)).toBe(false); }); it('should return true if object is empty and prototyped', () => { expect(utils.isEmpty(testCreatedNewObject)).toBe(true); }); it('should return true if array is empty', () => { expect(utils.isEmpty([])).toBe(true); }); it('should return false if array is not empty', () => { expect(utils.isEmpty([10])).toBe(false); }); it('should return true if null', () => { expect(utils.isEmpty(null)).toBe(true); }); });