UNPKG

moy-fp

Version:
24 lines (20 loc) 501 B
import __ from '../../src/Function/__' /** * Ord b => (a -> b) -> a -> a -> a */ import maxBy from '../../src/Relation/maxBy' test('maxBy(not using __), return first', () => { expect( maxBy(x => x.id)({id: 2})({id: 1}) ).toEqual({id: 2}) }) test('maxBy(not using __), return second', () => { expect( maxBy(x => x.id)({id: 1})({id: 2}) ).toEqual({id: 2}) }) test('maxBy(using __), return first', () => { expect( maxBy(x => x.id, __, {id: 1})({id: 2}) ).toEqual({id: 2}) })