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

12 lines
251 B
JavaScript

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