import { toArray } from './toArray';
describe('toArray', () => {
  test('should transform an object into an array of key-value pairs', () => {
    const obj = { name: 'John', age: 30, city: 'New York' };
    const arr = toArray(obj);
    expect(arr).toEqual([
      ['name', 'John'],
      ['age', 30],
      ['city', 'New York']
    ]);
  });

  test('should handle an empty object', () => {
    const obj = {};
    const arr = toArray(obj);
    expect(arr).toEqual([]);
  });

  test('should handle an object with nested objects', () => {
    const obj = {
      name: 'John',
      age: 30,
      address: {
        street: '123 Main St',
        city: 'New York'
      }
    };
    const arr = toArray(obj);
    expect(arr).toEqual([
      ['name', 'John'],
      ['age', 30],
      [
        'address',
        {
          street: '123 Main St',
          city: 'New York'
        }
      ]
    ]);
  });
});
