Add empty invocation test to string methods test.

This commit is contained in:
John-David Dalton
2015-10-25 02:10:08 -07:00
parent 4b86df4966
commit c3ec32cc16

View File

@@ -21845,11 +21845,16 @@
var func = _[methodName];
QUnit.test('`_.' + methodName + '` should return an empty string for empty values', function(assert) {
assert.expect(3);
assert.expect(1);
assert.strictEqual(func(null), '');
assert.strictEqual(func(undefined), '');
assert.strictEqual(func(''), '');
var values = [, null, undefined, ''],
expected = lodashStable.map(values, lodashStable.constant(''));
var actual = lodashStable.map(values, function(value, index) {
return index ? func(value) : func();
});
assert.deepEqual(actual, expected);
});
});
}());