import {pathEq} from 'rambda'
describe('R.pathEq', () => { it('with string path', () => { const pathToSearch = 'a.b.c' const input = {a: {b: {c: 1}}} const target = {c: 1}
const result = pathEq(pathToSearch, input, target) const curriedResult = pathEq(pathToSearch, input, target) result curriedResult })
it('with array path', () => { const pathToSearch = ['a', 'b', 'c'] const input = {a: {b: {c: 1}}} const target = {c: 1}
const result = pathEq(pathToSearch, input, target) const curriedResult = pathEq(pathToSearch, input, target) result curriedResult })})
describe('with ramda specs', () => { const testPath = ['x', 0, 'y'] const testObj = { x: [ {y: 2, z: 3}, {y: 4, z: 5}, ], }
const result1 = pathEq(testPath, 2, testObj) const result2 = pathEq(testPath, 2)(testObj) const result3 = pathEq(testPath)(2)(testObj) result1 result2 result3 })