1 import orderBy from './orderBy';
3 describe('orderBy()', () => {
4 it('orders an array of objects by the numeric value of a given property of the objects in the array', () => {
5 const arrayOfObjects = [{ id: 7 }, { id: 3 }, { id: 3 }, { id: 6 }, { id: 18 }, { id: 2 }];
7 const output = orderBy(arrayOfObjects, 'id');
9 const expected = [{ id: 2 }, { id: 3 }, { id: 3 }, { id: 6 }, { id: 7 }, { id: 18 }];
11 expect(output).toEqual(expected);