Skip to content

Commit

Permalink
Merge pull request #129 from 4lessandrodev/fix/crypto-context
Browse files Browse the repository at this point in the history
test: fix tests
  • Loading branch information
4lessandrodev authored Mar 25, 2024
2 parents 4ab9a70 + 87c3309 commit e9b3b3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/core/crypto.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { GenerateUUID } from '../../lib/core/crypto';
import { UUID } from '../../lib/core/crypto';

describe('randomUUID', () => {
it('should generate random uuid', () => {
const id = GenerateUUID();
const id = UUID();
expect(id).toHaveLength(36);
});

Expand All @@ -11,15 +11,15 @@ describe('randomUUID', () => {

let i = 0;
while (i < 300) {
map.set(i, GenerateUUID());
map.set(i, UUID());
i++;
}
expect(map.size).toBe(300);
});

it('should to have uuid v4 pattern', () => {
//f81d4fae-7dec-11d0-a765-00a0c91e6bf6
const id = GenerateUUID();
const id = UUID();
expect(id).toMatch(/.{8}\-.{4}\-.{4}\-.{4}\-.{12}$/)
})
});

0 comments on commit e9b3b3e

Please sign in to comment.