Skip to main content
Module

x/rambda/source/props.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import {props} from './props'
const obj = { a: 1, b: 2,}const propsToPick = ['a', 'c']
test('happy', () => { const result = props(propsToPick, obj) expect(result).toEqual([1, undefined])})
test('curried', () => { const result = props(propsToPick)(obj) expect(result).toEqual([1, undefined])})
test('wrong input', () => { expect(() => props(null)(obj)).toThrow()})