Files
2025-03-27 05:04:22 -07:00

16 lines
428 B
TypeScript

export const wait = async (t: number): Promise<void> => {
await new Promise((r) => setTimeout(r, t));
};
export const waitForPromises = async (): Promise<void> => {
jest.useRealTimers();
await new Promise((resolve) => setTimeout(resolve, 100) as any);
jest.useFakeTimers();
};
export const parseBody = (mockCall: any): any => {
const options = mockCall[1];
const body = JSON.parse(options.body);
return body;
};