mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Add tests for missing path parts for _.matchesProperty.
This commit is contained in:
10
test/test.js
10
test/test.js
@@ -9802,6 +9802,16 @@
|
|||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should return `false` if parts of `path` are missing', 2, function() {
|
||||||
|
var object = {},
|
||||||
|
matches = _.matchesProperty('a', 1);
|
||||||
|
|
||||||
|
strictEqual(matches(object), false);
|
||||||
|
|
||||||
|
matches = _.matchesProperty('a[1].b.c', 1);
|
||||||
|
strictEqual(matches(object), false);
|
||||||
|
});
|
||||||
|
|
||||||
test('should search arrays of `value` for values', 3, function() {
|
test('should search arrays of `value` for values', 3, function() {
|
||||||
var objects = [{ 'a': ['b'] }, { 'a': ['c', 'd'] }],
|
var objects = [{ 'a': ['b'] }, { 'a': ['c', 'd'] }],
|
||||||
matches = _.matchesProperty('a', ['d']),
|
matches = _.matchesProperty('a', ['d']),
|
||||||
|
|||||||
Reference in New Issue
Block a user