moy-fp
Version:
A functional programming library.
24 lines (20 loc) • 435 B
JavaScript
import __ from '../../src/Function/__'
/**
* [a] -> a | undefined
*/
import headList from '../../src/List/headList'
test('headList(not using __), not empty array', () => {
expect(
headList([1, 2, 3, 4])
).toBe(1)
})
test('headList(not using __), empty array', () => {
expect(
headList([])
).toBeUndefined()
})
test('headList(using __), not empty array', () => {
expect(
headList([1, 2, 3, 4])
).toBe(1)
})