From b84c3368557d7b556a75aa6977085e8e477d227b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 1 Nov 2015 17:30:06 -0800 Subject: [PATCH] Add `_.unary` tests. --- test/test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/test.js b/test/test.js index 502624c8b..0c537da9f 100644 --- a/test/test.js +++ b/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'); lodashStable.each(['union', 'unionBy', 'unionWith'], function(methodName) {