mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Ensure _.where deep compares properties values.
Former-commit-id: f3f29abf024f87a947fef6df1e3db9d9d1de99bf
This commit is contained in:
@@ -2353,6 +2353,15 @@
|
||||
test('should return an empty array when passed an empty `properties` object', function() {
|
||||
deepEqual(_.where(array, {}), []);
|
||||
});
|
||||
|
||||
test('should deep compare `properties` values', function() {
|
||||
var collection = [
|
||||
{ 'a': { 'b': 1 }, 'c': 2 },
|
||||
{ 'a': { 'b': 2 }, 'c': 3 }
|
||||
];
|
||||
|
||||
deepEqual(_.where(collection, { 'a': { 'b': 1 } }), [{ 'a': { 'b': 1 }, 'c': 2 }]);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user