gitlab-org--gitlab-foss/spec/frontend/helpers/fake_request_animation_frame.js

13 lines
253 B
JavaScript
Raw Normal View History

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