grafana/public/test/jest-shim.ts
Torkel Ödegaard 1d689888b0
Prettier: Upgrade to 2 (#30387)
* Updated package json but not updated source files

* Update eslint plugin

* updated files
2021-01-20 07:59:48 +01:00

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