Add _#toString test for nullish values.

This commit is contained in:
John-David Dalton
2015-09-27 10:03:43 -07:00
parent 7488068d50
commit 38ac518095

View File

@@ -20602,6 +20602,25 @@
skipTest(assert);
}
});
QUnit.test('should treat nullish values as empty strings', function(assert) {
assert.expect(1);
if (!isNpm) {
var values = [, null, undefined],
expected = _.map(values, _.constant(''));
var actual = _.map(values, function(value, index) {
var wrapped = index ? _(value) : _();
return String(wrapped);
});
assert.deepEqual(actual, expected);
}
else {
skipTest(assert);
}
});
}());
/*--------------------------------------------------------------------------*/