From cb2bf7f8faf941f6583280213cd90da2db28a6c0 Mon Sep 17 00:00:00 2001 From: jdalton Date: Sun, 5 Apr 2015 01:39:51 -0500 Subject: [PATCH] Add tests for missing `path` parts for `_.matchesProperty`. --- test/test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test.js b/test/test.js index 36e394d0b..33243361c 100644 --- a/test/test.js +++ b/test/test.js @@ -9802,6 +9802,16 @@ 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() { var objects = [{ 'a': ['b'] }, { 'a': ['c', 'd'] }], matches = _.matchesProperty('a', ['d']),