clean all
This commit is contained in:
1 parent
f57d6ec3d3
commit
27afb719f5
101 files changed
+45
-14426
No files matched your search
@@ -1,20 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { newId } from '@/lib/id';
|
||||
|
||||
describe('newId', () => {
|
||||
it('returns a string without prefix when called bare', () => {
|
||||
const id = newId();
|
||||
expect(typeof id).toBe('string');
|
||||
expect(id.length).toBe(12);
|
||||
});
|
||||
|
||||
it('prefixes when asked', () => {
|
||||
expect(newId('finding')).toMatch(/^finding_[A-Za-z0-9_-]{10}$/);
|
||||
});
|
||||
|
||||
it('is unique across 1000 calls', () => {
|
||||
const ids = new Set(Array.from({ length: 1000 }, () => newId()));
|
||||
expect(ids.size).toBe(1000);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user