13 lines
251 B
JavaScript
13 lines
251 B
JavaScript
|
export const useFakeRequestAnimationFrame = () => {
|
||
|
let orig;
|
||
|
|
||
|
beforeEach(() => {
|
||
|
orig = global.requestAnimationFrame;
|
||
|
global.requestAnimationFrame = cb => cb();
|
||
|
});
|
||
|
|
||
|
afterEach(() => {
|
||
|
global.requestAnimationFrame = orig;
|
||
|
});
|
||
|
};
|