mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Add _.differenceBy, _.intersectionBy, _.pickAllBy, _.unionBy, and _.xorBy tests.
This commit is contained in:
69
test/test.js
69
test/test.js
@@ -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) {
|
QUnit.test('`_.dropRightWhile` should use `_.iteratee` internally', function(assert) {
|
||||||
assert.expect(1);
|
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);
|
assert.expect(1);
|
||||||
|
|
||||||
if (!isModularize) {
|
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);
|
assert.expect(1);
|
||||||
|
|
||||||
if (!isModularize) {
|
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) {
|
QUnit.test('`_.keyBy` should use `_.iteratee` internally', function(assert) {
|
||||||
assert.expect(1);
|
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) {
|
QUnit.test('`_.reduce` should use `_.iteratee` internally', function(assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
|
|
||||||
@@ -10493,6 +10532,32 @@
|
|||||||
skipTest(assert);
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user