From d9dc0e6fd13c030029964b5ba468e0df3e2de3b2 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 16 Feb 2016 19:30:23 -0800 Subject: [PATCH] Add `_.invertBy` tests. --- test/test.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index b6369710a..763630d47 100644 --- a/test/test.js +++ b/test/test.js @@ -7674,11 +7674,25 @@ QUnit.test('should only add multiple values to own, not inherited, properties', function(assert) { assert.expect(1); - var expected = { 'hasOwnProperty': ['a'], 'constructor': ['b'] }, - object = { 'a': 'hasOwnProperty', 'b': 'constructor' }; + var object = { 'a': 'hasOwnProperty', 'b': 'constructor' }, + expected = { 'hasOwnProperty': ['a'], 'constructor': ['b'] }; assert.ok(lodashStable.isEqual(_.invertBy(object), expected)); }); + + QUnit.test('should return a wrapped value when chaining', function(assert) { + assert.expect(2); + + if (!isNpm) { + var wrapped = _(object).invertBy(); + + assert.ok(wrapped instanceof _); + assert.deepEqual(wrapped.value(), { '1': ['a', 'c'], '2': ['b'] }); + } + else { + skipAssert(assert, 2); + } + }); }()); /*--------------------------------------------------------------------------*/