Add _.differenceBy, _.intersectionBy, _.pickAllBy, _.unionBy, and _.xorBy tests.

This commit is contained in:
John-David Dalton
2015-10-07 00:18:42 -07:00
parent 1d425b1731
commit a21b25f751

View File

@@ -10073,6 +10073,19 @@
}
});
QUnit.test('`_.differenceBy` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
if (!isModularize) {
_.iteratee = getPropA;
assert.deepEqual(_.differenceBy(objects, [objects[1]]), [objects[0]]);
_.iteratee = iteratee;
}
else {
skipTest(assert);
}
});
QUnit.test('`_.dropRightWhile` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
@@ -10179,7 +10192,7 @@
}
});
QUnit.test('`_.findLastKey` should use `_.iteratee` internally', function(assert) {
QUnit.test('`_.findKey` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
if (!isModularize) {
@@ -10192,7 +10205,7 @@
}
});
QUnit.test('`_.findKey` should use `_.iteratee` internally', function(assert) {
QUnit.test('`_.findLastKey` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
if (!isModularize) {
@@ -10218,6 +10231,19 @@
}
});
QUnit.test('`_.intersectionBy` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
if (!isModularize) {
_.iteratee = getPropA;
assert.deepEqual(_.intersectionBy(objects, [objects[2]]), [objects[1]]);
_.iteratee = iteratee;
}
else {
skipTest(assert);
}
});
QUnit.test('`_.keyBy` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
@@ -10311,6 +10337,19 @@
}
});
QUnit.test('`_.pullAllBy` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
if (!isModularize) {
_.iteratee = getPropA;
assert.deepEqual(_.pullAllBy(objects.slice(), [{ 'a': 1, 'b': 0 }]), [objects[0]]);
_.iteratee = iteratee;
}
else {
skipTest(assert);
}
});
QUnit.test('`_.reduce` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
@@ -10493,6 +10532,32 @@
skipTest(assert);
}
});
QUnit.test('`_.unionBy` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
if (!isModularize) {
_.iteratee = getPropB;
assert.deepEqual(_.unionBy(objects.slice(0, 1), [objects[2]]), [objects[0], objects[2]]);
_.iteratee = iteratee;
}
else {
skipTest(assert);
}
});
QUnit.test('`_.xorBy` should use `_.iteratee` internally', function(assert) {
assert.expect(1);
if (!isModularize) {
_.iteratee = getPropA;
assert.deepEqual(_.xorBy(objects, objects.slice(1)), [objects[0]]);
_.iteratee = iteratee;
}
else {
skipTest(assert);
}
});
}());
/*--------------------------------------------------------------------------*/