mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Add an _.invoke test for deep paths.
This commit is contained in:
@@ -6883,6 +6883,14 @@
|
|||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should invoke deep property methods with the correct `this` binding', 2, function() {
|
||||||
|
var object = { 'a': { 'b': function() { this.c; }, 'c': 1 } };
|
||||||
|
|
||||||
|
_.each(['a.b', ['a', 'b']], function(path) {
|
||||||
|
deepEqual(_.invoke([object], path), [1]);
|
||||||
|
});
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user