0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00
logto/packages/shared/src/utils/id.test.ts

16 lines
380 B
TypeScript
Raw Normal View History

import { buildIdGenerator } from './id.js';
describe('id generator', () => {
it('should match the input length', () => {
const id = buildIdGenerator(10)();
expect(id.length).toEqual(10);
});
it('to random id should not equal', () => {
const id_1 = buildIdGenerator(10)();
const id_2 = buildIdGenerator(10)();
expect(id_1).not.toEqual(id_2);
});
});