text: import groupByKey from '../groupByKey';
  
  describe('groupByKey', () => {
      it('group elements in array by key specified', () => {
          const arr = [
              {
                  text: 'zero',
                  value: 0,
              },
              {
                  text: 'one',
                  value: 1,
              },
              {
                  text: 'zero',
                  value: 0,
              },
              {
                  text: 'one',
                  value: 1,
              },
              {
                  text: 'two',
                  value: 2,
              },
              {
                  text: 'two',
                  value: 2,
              },
              {
                  text: 'three',
                  value: 3,
              },
              {
                  text: 'four',
                  value: 4,
              },
          ];
  
          const grouped = groupByKey(arr, 'value');
          expect(Object.keys(grouped).length).toEqual(5);
      });
  });
  