* Generate deterministic valid UUIDs for testing
(prefix: string, index: number)
| 7 | * Generate deterministic valid UUIDs for testing |
| 8 | */ |
| 9 | function generateId(prefix: string, index: number): string { |
| 10 | const key = `${prefix}-${index}` |
| 11 | if (!uuidCache.has(key)) { |
| 12 | // Generate a real UUID but make it deterministic for the same prefix+index |
| 13 | const hex = index.toString(16).padStart(8, `0`) |
| 14 | // Create a valid UUID v4 format |
| 15 | uuidCache.set( |
| 16 | key, |
| 17 | `${hex.slice(0, 8)}-0000-4000-8000-${hex.padStart(12, `0`)}`, |
| 18 | ) |
| 19 | } |
| 20 | return uuidCache.get(key)! |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Generate seed data with proper distributions for testing |
no test coverage detected