moy-fp
Version:
A functional programming library.
28 lines (25 loc) • 456 B
JavaScript
import __ from '../../src/Function/__'
/**
* [[k, v]] -> {k: v}
*/
import fromPairs from '../../src/List/fromPairs'
test('fromPairs(not using __)', () => {
expect(
fromPairs([['a', 1], ['b', 2], ['c', 3], ['d', 4]])
).toEqual({
a: 1,
b: 2,
c: 3,
d: 4,
})
})
test('fromPairs(using __)', () => {
expect(
fromPairs(__)([['a', 1], ['b', 2], ['c', 3], ['d', 4]])
).toEqual({
a: 1,
b: 2,
c: 3,
d: 4,
})
})