Files
xOld_appRoboticsDriver/node_modules/jest-websocket-mock/lib/act-compat.d.ts
2025-12-27 20:24:47 +01:00

13 lines
588 B
TypeScript

/**
* A simple compatibility method for react's "act".
* If @testing-library/react is already installed, we just use
* their implementation - it's complete and has useful warnings.
* If @testing-library/react is *not* installed, then we just assume
* that the user is not testing a react application, and use a noop instead.
*/
declare type Callback = () => Promise<void | undefined> | void | undefined;
declare type AsyncAct = (callback: Callback) => Promise<undefined>;
declare type SyncAct = (callback: Callback) => void;
declare let act: AsyncAct | SyncAct;
export default act;