16 lines
463 B
TypeScript
16 lines
463 B
TypeScript
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
import { generateId } from "./id.js";
|
|
|
|
describe("generateId", () => {
|
|
it("emits 32 hex chars", { timeout: 5000 }, () => {
|
|
const id = generateId();
|
|
expect(id).toMatch(/^[0-9a-f]{32}$/);
|
|
});
|
|
|
|
it("never repeats across consecutive calls", { timeout: 5000 }, () => {
|
|
const a = generateId();
|
|
const b = generateId();
|
|
expect(a).not.toBe(b);
|
|
});
|
|
});
|