import { groupBy } from './group-by';

describe('groupBy', () => {
  it('should group a list by keys', () => {
    const given = ['one', 'two', 'three'];

    const when = groupBy(given, (item) => item.length);

    expect(when).toEqual({
      3: ['one', 'two'],
      5: ['three'],
    });
  });
});
