From b5bbc18c89801971111cd831b060ecc3b90e3aa3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 20 Sep 2015 17:05:30 -0700 Subject: [PATCH] Add `_#next` test for `_.toArray` results. --- test/test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/test.js b/test/test.js index da69058e0..21fd24598 100644 --- a/test/test.js +++ b/test/test.js @@ -20061,6 +20061,23 @@ } }); + QUnit.test('should use `_.toArray` to generate the iterable result ' + chainType, function(assert) { + assert.expect(3); + + if (!isNpm && Array.from) { + var hearts = '\ud83d\udc95', + values = [[1], { 'a': 1 }, hearts]; + + _.each(values, function(value) { + var wrapped = chain(value); + assert.deepEqual(Array.from(wrapped), _.toArray(value)); + }); + } + else { + skipTest(assert, 3); + } + }); + QUnit.test('should reset the iterator correctly ' + chainType, function(assert) { assert.expect(4);