Add config for objectId size (#3950)
* Add objectId config property, default to 10 * Update Config constructor * Add test for backwards compatibility when changing objectId size
This commit is contained in:
committed by
Natan Rolnik
parent
bd6816c14c
commit
51d2dd92cb
@@ -63,6 +63,10 @@ describe('newObjectId', () => {
|
||||
expect(cryptoUtils.newObjectId().length).toBeGreaterThan(9);
|
||||
});
|
||||
|
||||
it('returns result with required number of characters', () => {
|
||||
expect(cryptoUtils.newObjectId(42).length).toBe(42);
|
||||
});
|
||||
|
||||
it('returns unique results', () => {
|
||||
expect(givesUniqueResults(() => cryptoUtils.newObjectId(), 100)).toBe(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user