8 lines
378 B
TypeScript
8 lines
378 B
TypeScript
|
|
import { test } from 'node:test';
|
||
|
|
import assert from 'node:assert/strict';
|
||
|
|
import { clockRequestId } from './clock-request';
|
||
|
|
test('manual clock lookup can generate a retry ID on HTTP where randomUUID is unavailable',()=>{
|
||
|
|
const fallback={getRandomValues:(array:Uint8Array)=>{array.fill(7);return array;}};
|
||
|
|
assert.match(clockRequestId(fallback),/^[a-zA-Z0-9-]{16,64}$/);
|
||
|
|
});
|