mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Add _.divide and _.multiply tests.
This commit is contained in:
42
test/test.js
42
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');
|
QUnit.module('lodash.drop');
|
||||||
|
|
||||||
(function() {
|
(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');
|
QUnit.module('lodash.orderBy');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user