mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Add _.negate unit test.
This commit is contained in:
16
test/test.js
16
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');
|
QUnit.module('lodash.noop');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user