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

produce.spec.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { add, pipe } from '../rambda.js'import { produce } from './produce.js'
const rules = { a : pipe(add(2), add(3)), b : x => ({ foo : x }), c : { d : add(2), e : add(10), },}
const expected = { a : 6, b : { foo : 1 }, c : { d : 3, e : 11, },}
test('happy', () => { const result = produce(rules, 1) expect(result).toEqual(expected)})
test('curried', () => { const result = produce(rules)(1) expect(result).toEqual(expected)})
rambda

Version Info

Tagged at
7 months ago