riya_business_travel_8.0.0_.../public/test/jest-shim.ts
venbatechnologies@gmail.com 565484c22d Modified initial commit
2021-07-05 14:17:23 +05:30

18 lines
422 B
TypeScript

declare var global: NodeJS.Global;
(global as any).requestAnimationFrame = (callback: any) => {
setTimeout(callback, 0);
};
(Promise.prototype as any).finally = function (onFinally: any) {
return this.then(
/* onFulfilled */
(res: any) => Promise.resolve(onFinally()).then(() => res),
/* onRejected */
(err: any) =>
Promise.resolve(onFinally()).then(() => {
throw err;
})
);
};