debian-mirror-gitlab/spec/frontend/helpers/fake_request_animation_frame.js
2020-08-09 17:44:08 +05:30

13 lines
308 B
JavaScript

// 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;
});
};