Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/helpers/fake_request_animation_frame.js')
-rw-r--r--spec/frontend/helpers/fake_request_animation_frame.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/frontend/helpers/fake_request_animation_frame.js b/spec/frontend/helpers/fake_request_animation_frame.js
new file mode 100644
index 00000000000..b01ae5b7c5f
--- /dev/null
+++ b/spec/frontend/helpers/fake_request_animation_frame.js
@@ -0,0 +1,13 @@
+// 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;
+ });
+};