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

13 lines
251 B
JavaScript
Raw Normal View History

2020-07-28 23:09:34 +05:30
export const useFakeRequestAnimationFrame = () => {
let orig;
beforeEach(() => {
orig = global.requestAnimationFrame;
global.requestAnimationFrame = cb => cb();
});
afterEach(() => {
global.requestAnimationFrame = orig;
});
};