Add _.divide and _.multiply.

This commit is contained in:
John-David Dalton
2016-03-19 21:00:29 -07:00
parent b2bff1ad45
commit 6eb0cb1565
4 changed files with 111 additions and 51 deletions

View File

@@ -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() {