debian-mirror-gitlab/spec/frontend/helpers/fake_request_animation_frame.js

14 lines
308 B
JavaScript
Raw Normal View History

2020-07-28 23:09:34 +05:30
// eslint-disable-next-line import/prefer-default-export
export const useFakeRequestAnimationFrame = () => {
let orig;
beforeEach(() => {
orig = global.requestAnimationFrame;
global.requestAnimationFrame = cb => cb();
});
afterEach(() => {
global.requestAnimationFrame = orig;
});
};