Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2
3import { createPreviewAutomationClientId } from "./previewAutomationClientId";
4
5describe("createPreviewAutomationClientId", () => {
6 it("creates bounded cryptographically random identities for independent host lifetimes", () => {
7 const clientIds = Array.from({ length: 32 }, createPreviewAutomationClientId);
8
9 expect(new Set(clientIds).size).toBe(clientIds.length);
10 expect(clientIds.every((clientId) => clientId.startsWith("preview-"))).toBe(true);
11 expect(clientIds.every((clientId) => clientId.length <= 128)).toBe(true);
12 });
13});