import { omit } from './omit';

describe('omit', () => {
  test('should omit all keys from an object', () => {
    const obj = {
      name: 'John',
      __typename: {
        name: 'John'
      }
    };
    const newObj = omit(obj, ['__typename']);
    expect(newObj).toEqual({
      name: 'John'
    });
  });

  test('should return an empty object if all keys are omitted', () => {
    const obj = {
      name: 'John',
      __typename: {
        name: 'John'
      }
    };
    const newObj = omit(obj, ['__typename', 'name']);
    expect(newObj).toEqual({});
  });

  test('should return the original object if no keys are omitted', () => {
    const obj = {
      name: 'John',
      __typename: {
        name: 'John'
      }
    };
    const newObj = omit(obj, []);
    expect(newObj).toEqual(obj);
  });
});
