grafana/public/test/jest-shim.ts
renovate[bot] 8d06bddeda
Update dependency @types/node to v14 (#40405)
* Update dependency @types/node to v14

* Remove global var

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-10-21 16:52:26 +02:00

16 lines
386 B
TypeScript

(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;
})
);
};