mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Add empty invocation test to string methods test.
This commit is contained in:
13
test/test.js
13
test/test.js
@@ -21845,11 +21845,16 @@
|
|||||||
var func = _[methodName];
|
var func = _[methodName];
|
||||||
|
|
||||||
QUnit.test('`_.' + methodName + '` should return an empty string for empty values', function(assert) {
|
QUnit.test('`_.' + methodName + '` should return an empty string for empty values', function(assert) {
|
||||||
assert.expect(3);
|
assert.expect(1);
|
||||||
|
|
||||||
assert.strictEqual(func(null), '');
|
var values = [, null, undefined, ''],
|
||||||
assert.strictEqual(func(undefined), '');
|
expected = lodashStable.map(values, lodashStable.constant(''));
|
||||||
assert.strictEqual(func(''), '');
|
|
||||||
|
var actual = lodashStable.map(values, function(value, index) {
|
||||||
|
return index ? func(value) : func();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepEqual(actual, expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|||||||
Reference in New Issue
Block a user