From 4c1b578b80f4876e1a4127fcafd93661c75b61bf Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 31 Aug 2015 19:16:00 -0700 Subject: [PATCH] Add `_#plant` test for cloned `chainAll` settings. --- test/test.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 8e961112b..04a9f30b4 100644 --- a/test/test.js +++ b/test/test.js @@ -16638,19 +16638,34 @@ } }); - test('should reset iterator data on cloned sequences', 2, function() { + test('should clone `chainAll` settings', 1, function() { + if (!isNpm) { + var array1 = [2, 4], + array2 = [6, 8], + wrapped1 = _(array1).chain().map(square), + wrapped2 = wrapped1.plant(array2); + + deepEqual(wrapped2.first().value(), 36); + } + else { + skipTest(); + } + }); + + test('should reset iterator data on cloned sequences', 3, function() { if (!isNpm) { var array1 = [2, 4], array2 = [6, 8], wrapped1 = _(array1).map(square); deepEqual(_.toArray(wrapped1), [4, 16]); + deepEqual(_.toArray(wrapped1), []); var wrapped2 = wrapped1.plant(array2); deepEqual(_.toArray(wrapped2), [36, 64]); } else { - skipTest(2); + skipTest(3); } }); }());