moy-fp
Version:
A functional programming library.
24 lines (20 loc) • 445 B
JavaScript
import __ from '../../src/Function/__'
/**
* k -> {k: v} -> Boolean
*/
import has from '../../src/Object/has'
test('has(not using __), return true', () => {
expect(
has('a')({a: 1, b: 2, c: 3})
).toBeTruthy()
})
test('has(not using __), return false', () => {
expect(
has('d')({a: 1, b: 2, c: 3})
).toBeFalsy()
})
test('has(using __), return true', () => {
expect(
has(__, {a: 1, b: 2, c: 3})('a')
).toBeTruthy()
})