From 7d8531d6ed861ec4b58a2a7ac3b3860446f0f1ec Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 20 Mar 2016 11:03:29 -0700 Subject: [PATCH] Add `_.divide` and `_.multiply` tests. --- test/test.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/test/test.js b/test/test.js index 60018f1f0..c0223f0de 100644 --- a/test/test.js +++ b/test/test.js @@ -4709,6 +4709,27 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.divide'); + + (function() { + QUnit.test('should divide two numbers', function(assert) { + assert.expect(3); + + assert.strictEqual(_.divide(6, 4), 1.5); + assert.strictEqual(_.divide(-6, 4), -1.5); + assert.strictEqual(_.divide(-6, -4), 1.5); + }); + + QUnit.test('should coerce arguments to numbers', function(assert) { + assert.expect(2); + + assert.strictEqual(_.divide('6', '4'), 1.5); + assert.deepEqual(_.divide('x', 'y'), NaN); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.drop'); (function() { @@ -15275,6 +15296,27 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.multiply'); + + (function() { + QUnit.test('should multiply two numbers', function(assert) { + assert.expect(3); + + assert.strictEqual(_.multiply(6, 4), 24); + assert.strictEqual(_.multiply(-6, 4), -24); + assert.strictEqual(_.multiply(-6, -4), 24); + }); + + QUnit.test('should coerce arguments to numbers', function(assert) { + assert.expect(2); + + assert.strictEqual(_.multiply('6', '4'), 24); + assert.deepEqual(_.multiply('x', 'y'), NaN); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.orderBy'); (function() {