Skip to content

Commit d9dc0e6

Browse files
committed
Add _.invertBy tests.
1 parent 53168e4 commit d9dc0e6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

test/test.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7674,11 +7674,25 @@
76747674
QUnit.test('should only add multiple values to own, not inherited, properties', function(assert) {
76757675
assert.expect(1);
76767676

7677-
var expected = { 'hasOwnProperty': ['a'], 'constructor': ['b'] },
7678-
object = { 'a': 'hasOwnProperty', 'b': 'constructor' };
7677+
var object = { 'a': 'hasOwnProperty', 'b': 'constructor' },
7678+
expected = { 'hasOwnProperty': ['a'], 'constructor': ['b'] };
76797679

76807680
assert.ok(lodashStable.isEqual(_.invertBy(object), expected));
76817681
});
7682+
7683+
QUnit.test('should return a wrapped value when chaining', function(assert) {
7684+
assert.expect(2);
7685+
7686+
if (!isNpm) {
7687+
var wrapped = _(object).invertBy();
7688+
7689+
assert.ok(wrapped instanceof _);
7690+
assert.deepEqual(wrapped.value(), { '1': ['a', 'c'], '2': ['b'] });
7691+
}
7692+
else {
7693+
skipAssert(assert, 2);
7694+
}
7695+
});
76827696
}());
76837697

76847698
/*--------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)