mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Add _.unary tests.
This commit is contained in:
24
test/test.js
24
test/test.js
@@ -20261,6 +20261,30 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
QUnit.module('lodash.unary');
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
function fn() {
|
||||||
|
return slice.call(arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
QUnit.test('should cap the number of params provided to `func`', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
|
||||||
|
var actual = lodashStable.map(['6', '8', '10'], _.unary(parseInt));
|
||||||
|
assert.deepEqual(actual, [6, 8, 10]);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('should work when provided less than the capped numer of arguments', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
|
||||||
|
var capped = _.unary(fn);
|
||||||
|
assert.deepEqual(capped(), []);
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
QUnit.module('union methods');
|
QUnit.module('union methods');
|
||||||
|
|
||||||
lodashStable.each(['union', 'unionBy', 'unionWith'], function(methodName) {
|
lodashStable.each(['union', 'unionBy', 'unionWith'], function(methodName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user