Revision c42a546055737158f9fe7548d877f23253dfdc1b authored by Jack Baldry on 07 July 2022, 18:02:35 UTC, committed by grafanabot on 07 July 2022, 18:03:59 UTC
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit 1976edaffcd64f2ba6dc5b38a63f91d01f7a29f1)
1 parent 91585c7
Raw File
jest-shim.ts
(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;
      })
  );
};
back to top