diff options
author | Natalia Tepluhina <ntepluhina@gitlab.com> | 2019-08-06 12:02:23 +0000 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-08-06 12:02:23 +0000 |
commit | 3283e4397fab09be6fe9496b6a20ff08cc17fa5a (patch) | |
tree | 3e77d4a93212ebbf32ff053f6c5f80ca1ecb7997 /spec/frontend/test_setup.js | |
parent | fd92bd24f919fbe7f184c2fc49dd7b944b634825 (diff) | |
download | gitlab-ce-3283e4397fab09be6fe9496b6a20ff08cc17fa5a.tar.gz |
Revert "Fixed comparing value to undefined"
This reverts commit d754beb74fbc06a2c744e15be4aa2831d8cef1c0.
Diffstat (limited to 'spec/frontend/test_setup.js')
-rw-r--r-- | spec/frontend/test_setup.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js index e4d62b044ca..8b6f7802b15 100644 --- a/spec/frontend/test_setup.js +++ b/spec/frontend/test_setup.js @@ -75,3 +75,18 @@ global.MutationObserver = () => ({ disconnect: () => {}, observe: () => {}, }); + +Object.assign(global, { + requestIdleCallback(cb) { + const start = Date.now(); + return setTimeout(() => { + cb({ + didTimeout: false, + timeRemaining: () => Math.max(0, 50 - (Date.now() - start)), + }); + }); + }, + cancelIdleCallback(id) { + clearTimeout(id); + }, +}); |