Skip to content

Commit

Permalink
fix(test): Hexadecimal 32-bit pseudo random sometimes conflicts in th…
Browse files Browse the repository at this point in the history
…e test

Fixes: #1928
  • Loading branch information
igarashitm committed Jan 21, 2025
1 parent 99d9c32 commit 37530b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/src/camel-utils/camel-random-id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('camel-random-id', () => {
.mockImplementation(() => ({ getRandomValues: () => [Date.now()] }) as unknown as Crypto);
const one = getHexaDecimalRandomId('test');
expect(one).toMatch(/test-[0-9a-f]{1,8}/);
await new Promise((f) => setTimeout(f, 1));
await new Promise((f) => setTimeout(f, 10));
const two = getHexaDecimalRandomId('test');
expect(two).toMatch(/test-[0-9a-f]{1,8}/);
expect(one).not.toEqual(two);
Expand Down

0 comments on commit 37530b5

Please sign in to comment.