mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
wip: code formatting nits continued
This commit is contained in:
19
test/uniqueId.spec.js
Normal file
19
test/uniqueId.spec.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import lodashStable from 'lodash';
|
||||
import uniqueId from '../src/uniqueId';
|
||||
|
||||
describe('uniqueId', () => {
|
||||
it('should generate unique ids', () => {
|
||||
const actual = lodashStable.times(1000, () => uniqueId());
|
||||
|
||||
expect(lodashStable.uniq(actual).length).toBe(actual.length);
|
||||
});
|
||||
|
||||
it('should return a string value when not providing a `prefix`', () => {
|
||||
expect(typeof uniqueId()).toBe('string');
|
||||
});
|
||||
|
||||
it('should coerce the prefix argument to a string', () => {
|
||||
const actual = [uniqueId(3), uniqueId(2), uniqueId(1)];
|
||||
expect(/3\d+,2\d+,1\d+/.test(actual));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user