Files
2026-05-27 23:47:53 +01:00

16 lines
634 B
TypeScript

// React-specific polyfill layer. The base webcrypto polyfill is loaded via
// `@suaveplan/testing/polyfills` (see vitest.config.ts setupFiles). This
// file adds the React 18+ `IS_REACT_ACT_ENVIRONMENT` global expected by
// React DOM when assertions are made outside an `act(...)` wrapper, plus
// any future DOM-only polyfills that should not leak into the universal
// `@suaveplan/testing/polyfills` entry.
interface ReactActEnvWindow {
IS_REACT_ACT_ENVIRONMENT?: boolean;
}
const win = globalThis as unknown as ReactActEnvWindow;
if (win.IS_REACT_ACT_ENVIRONMENT === undefined) {
win.IS_REACT_ACT_ENVIRONMENT = true;
}