From d4e058a84430697bb0f706bc93bd81fc2f6f73e4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 19 Aug 2014 09:08:04 -0700 Subject: [PATCH] Add `_.negate` unit test. --- test/test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test.js b/test/test.js index 3becd5f6c..51e4cf6b8 100644 --- a/test/test.js +++ b/test/test.js @@ -7656,6 +7656,22 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.negate'); + + (function() { + test('should create a function that negates the result of `func`', 2, function() { + function isEven(n) { + return n % 2 == 0; + } + + var negate = _.negate(isEven); + strictEqual(negate(1), true); + strictEqual(negate(2), false); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.noop'); (function() {