import { getEntries, hasOwn, isObjectEmpty } from './func.utils'; describe('getEntries', () => { it('should return an empty array if the input object is empty', () => { const obj = {}; const result = getEntries(obj); expect(result).toEqual([]); }); it('should return an array of key-value pairs for each property in the input object', () => { const obj = { name: 'John', age: 30, city: 'New York', }; const result = getEntries(obj); expect(result).toEqual([ ['name', 'John'], ['age', 30], ['city', 'New York'], ]); }); it('should not include properties from the object prototype chain', () => { const obj = Object.create({ prop: 'value' }); obj.name = 'John'; obj.age = 30; const result = getEntries(obj); expect(result).toEqual([ ['name', 'John'], ['age', 30], ]); }); }); describe('hasOwn', () => { it('should return true if the object has the specified property', () => { const obj = { name: 'John', age: 30 }; const prop = 'name'; const result = hasOwn(obj, prop); expect(result).toBe(true); }); it('should return false if the object does not have the specified property', () => { const obj = { name: 'John', age: 30 }; const prop = 'city'; const result = hasOwn(obj, prop); expect(result).toBe(false); }); }); describe('isObjectEmpty', () => { it('should return true if the object is empty', () => { const obj = {}; const result = isObjectEmpty(obj); expect(result).toBe(true); }); it('should return false if the object is not empty', () => { const obj = { name: 'John', age: 30 }; const result = isObjectEmpty(obj); expect(result).toBe(false); }); });