deno.land / x / rambda@v9.1.1 / source / props.spec.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { props } from './props.js'
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)).toThrowErrorMatchingInlineSnapshot('"propsToPick is not a list"')})
rambda

Version Info

Tagged at
2 months ago