Add _.negate unit test.

This commit is contained in:
John-David Dalton
2014-08-19 09:08:04 -07:00
parent 8f9eed154e
commit d4e058a844

View File

@@ -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() {