Files
Entropyk/apps/web/vitest.setup.ts
sepehr 3358b74342 Add diagram workbench UI with Modelica DoF coaching and ISO glyphs.
Ship the Next.js cycle editor with CAD chrome, technical HX symbols, Fixed/Free boundary guidance, and secondary water/air pressure drop support in the solver stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 22:46:46 +02:00

18 lines
719 B
TypeScript

import "@testing-library/jest-dom/vitest";
import { afterEach } from "vitest";
import { cleanup } from "@testing-library/react";
// crypto.randomUUID is used by the diagram store; jsdom may not provide it.
const existingCrypto = (globalThis as { crypto?: Partial<Crypto> }).crypto;
if (typeof existingCrypto?.randomUUID !== "function") {
let counter = 0;
const randomUUID = (): `${string}-${string}-${string}-${string}-${string}` =>
`00000000-0000-4000-8000-${String(counter++).padStart(12, "0")}` as const;
const cryptoStub = { ...(existingCrypto ?? {}), randomUUID } as Crypto;
Object.defineProperty(globalThis, "crypto", { value: cryptoStub, configurable: true });
}
afterEach(() => {
cleanup();
});