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

pathEq.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
import { pathEq } from './pathEq.js'
test('when true', () => { const path = 'a.b' const obj = { a : { b : { c : 1 } } } const target = { c : 1 }
expect(pathEq( path, target, obj )).toBeTrue()})
test('when false', () => { const path = 'a.b' const obj = { a : { b : 1 } } const target = 2
expect(pathEq(path, target)(obj)).toBeFalse()})
test('when wrong path', () => { const path = 'foo.bar' const obj = { a : { b : 1 } } const target = 2
expect(pathEq( path, target, obj )).toBeFalse()})
rambda

Version Info

Tagged at
2 months ago