debian-mirror-gitlab/spec/frontend/__helpers__/fake_request_animation_frame.js
2021-03-08 18:12:59 +05:30

13 lines
253 B
JavaScript

export const useFakeRequestAnimationFrame = () => {
let orig;
beforeEach(() => {
orig = global.requestAnimationFrame;
global.requestAnimationFrame = (cb) => cb();
});
afterEach(() => {
global.requestAnimationFrame = orig;
});
};