Skip to content

Commit

Permalink
Add _.invertBy tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Feb 17, 2016
1 parent 53168e4 commit d9dc0e6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}());

/*--------------------------------------------------------------------------*/
Expand Down

0 comments on commit d9dc0e6

Please sign in to comment.