mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Add _.divide and _.multiply.
This commit is contained in:
@@ -929,7 +929,7 @@
|
||||
var func = fp[methodName],
|
||||
isAdd = methodName == 'add';
|
||||
|
||||
QUnit.test('`fp.' + methodName + '` should have `rearg` applied', function(assert) {
|
||||
QUnit.test('`fp.' + methodName + '` should not have `rearg` applied', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.strictEqual(func('1')('2'), isAdd ? '12' : -1);
|
||||
@@ -1021,6 +1021,21 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('fp.divide and fp.multiply');
|
||||
|
||||
_.each(['divide', 'multiply'], function(methodName) {
|
||||
var func = fp[methodName],
|
||||
isDivide = methodName == 'divide';
|
||||
|
||||
QUnit.test('`fp.' + methodName + '` should not have `rearg` applied', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.strictEqual(func('2')('4'), isDivide ? 0.5 : 8);
|
||||
});
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('fp.extend');
|
||||
|
||||
(function() {
|
||||
|
||||
14
test/test.js
14
test/test.js
@@ -24677,11 +24677,13 @@
|
||||
|
||||
(function() {
|
||||
var funcs = [
|
||||
'add',
|
||||
'camelCase',
|
||||
'capitalize',
|
||||
'ceil',
|
||||
'clone',
|
||||
'deburr',
|
||||
'divide',
|
||||
'endsWith',
|
||||
'escape',
|
||||
'escapeRegExp',
|
||||
@@ -24731,6 +24733,7 @@
|
||||
'maxBy',
|
||||
'min',
|
||||
'minBy',
|
||||
'multiply',
|
||||
'pad',
|
||||
'padEnd',
|
||||
'padStart',
|
||||
@@ -24749,6 +24752,7 @@
|
||||
'some',
|
||||
'startCase',
|
||||
'startsWith',
|
||||
'subtract',
|
||||
'sum',
|
||||
'toInteger',
|
||||
'toLower',
|
||||
@@ -24770,9 +24774,7 @@
|
||||
assert.expect(1);
|
||||
|
||||
if (!isNpm) {
|
||||
var array = [1, 2, 3],
|
||||
actual = _(array)[methodName]();
|
||||
|
||||
var actual = _()[methodName]();
|
||||
assert.notOk(actual instanceof _);
|
||||
}
|
||||
else {
|
||||
@@ -24784,9 +24786,7 @@
|
||||
assert.expect(1);
|
||||
|
||||
if (!isNpm) {
|
||||
var array = [1, 2, 3],
|
||||
actual = _(array).chain()[methodName]();
|
||||
|
||||
var actual = _().chain()[methodName]();
|
||||
assert.ok(actual instanceof _);
|
||||
}
|
||||
else {
|
||||
@@ -25012,7 +25012,7 @@
|
||||
var acceptFalsey = lodashStable.difference(allMethods, rejectFalsey);
|
||||
|
||||
QUnit.test('should accept falsey arguments', function(assert) {
|
||||
assert.expect(305);
|
||||
assert.expect(307);
|
||||
|
||||
var emptyArrays = lodashStable.map(falsey, alwaysEmptyArray);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user