12 lines
455 B
TypeScript
12 lines
455 B
TypeScript
// React-specific polyfills. The base webcrypto polyfill loads via
|
|
// `@suaveplan/testing/polyfills`. This sets the React 18+
|
|
// `IS_REACT_ACT_ENVIRONMENT` flag so DOM assertions outside `act(...)`
|
|
// don't generate runtime warnings.
|
|
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;
|
|
}
|