mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Add a non-deep property test for _.get.
This commit is contained in:
@@ -5998,6 +5998,11 @@
|
|||||||
QUnit.module('lodash.get');
|
QUnit.module('lodash.get');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
test('should get property values', 1, function() {
|
||||||
|
var object = { 'a': 'b' };
|
||||||
|
strictEqual(_.get(object, 'a'), 'b');
|
||||||
|
});
|
||||||
|
|
||||||
test('should get deep property values', 1, function() {
|
test('should get deep property values', 1, function() {
|
||||||
var object = { 'a': { 'b': { 'c': 3 } } };
|
var object = { 'a': { 'b': { 'c': 3 } } };
|
||||||
strictEqual(_.get(object, 'a.b.c'), 3);
|
strictEqual(_.get(object, 'a.b.c'), 3);
|
||||||
|
|||||||
Reference in New Issue
Block a user