debian-mirror-gitlab/spec/frontend/helpers/fake_request_animation_frame.js
2020-11-24 15:15:51 +05:30

12 lines
251 B
JavaScript

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