import { keys } from './keys';

describe('keys', () => {
  test('should return an array of keys from a non-empty object', () => {
    const obj = {
      a: 1,
      b: 2,
      c: 3
    };

    const result = keys(obj);

    expect(result).toEqual(['a', 'b', 'c']);
  });

  test('should return an empty array if the object is empty', () => {
    const obj = {};

    const result = keys(obj);

    expect(result).toEqual([]);
  });

  test('should throw a TypeError if the input is not an object', () => {
    const input = 123;

    expect(() => {
      keys(input);
    }).toThrow(TypeError);
  });
});
