mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Make _.uniqueId consistently return a string value.
Former-commit-id: 5a5c626df83b0fc78e9bae37510680383f112c0b
This commit is contained in:
15
test/test.js
15
test/test.js
@@ -1878,6 +1878,21 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.uniqueId');
|
||||
|
||||
(function() {
|
||||
test('should return a string value when not passing a prefix argument', function() {
|
||||
equal(typeof _.uniqueId(), 'string');
|
||||
});
|
||||
|
||||
test('should coerce the prefix argument to a string', function() {
|
||||
var actual = [_.uniqueId(3), _.uniqueId(2), _.uniqueId(1)];
|
||||
equal(/3\d+,2\d+,1\d+/.test(actual), true);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.where');
|
||||
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user