From 6dc92df880ec2475ca3113f7ff82965e8958b633 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 24 Nov 2015 16:08:45 -0800 Subject: [PATCH] Add implicit chaining test for `_.invokePath`. --- test/test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/test.js b/test/test.js index 5420df16a..031610567 100644 --- a/test/test.js +++ b/test/test.js @@ -7208,6 +7208,30 @@ assert.deepEqual(_.invokePath(object, path), 1); }); }); + + QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) { + assert.expect(1); + + if (!isNpm) { + var object = { 'a': lodashStable.constant(1) }; + assert.strictEqual(_(object).invokePath('a'), 1); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should return a wrapped value when explicitly chaining', function(assert) { + assert.expect(1); + + if (!isNpm) { + var object = { 'a': lodashStable.constant(1) }; + assert.ok(_(object).chain().invokePath('a') instanceof _); + } + else { + skipTest(assert); + } + }); }()); /*--------------------------------------------------------------------------*/