summaryrefslogtreecommitdiff
path: root/spec/frontend/__mocks__/lodash/debounce.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-04 00:09:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-04 00:09:37 +0000
commite3bdfa1a13d7e6c92716324c78b5b20c07eeb7c6 (patch)
treee8776263096b027d32d4be5118cccc87b00de2bc /spec/frontend/__mocks__/lodash/debounce.js
parentc1a50b8195f4e36fda9b233acbde57a449bcf6c3 (diff)
downloadgitlab-ce-e3bdfa1a13d7e6c92716324c78b5b20c07eeb7c6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/__mocks__/lodash/debounce.js')
-rw-r--r--spec/frontend/__mocks__/lodash/debounce.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/__mocks__/lodash/debounce.js b/spec/frontend/__mocks__/lodash/debounce.js
new file mode 100644
index 00000000000..97fdb39097a
--- /dev/null
+++ b/spec/frontend/__mocks__/lodash/debounce.js
@@ -0,0 +1,11 @@
+// `lodash/debounce` has a non-trivial implementation which can lead to
+// [flaky spec errors][1]. This mock simply makes `debounce` calls synchronous.
+//
+// In the future we could enhance this by injecting some test values in
+// the function passed to it. See [this issue][2] for more information.
+//
+// [1]: https://gitlab.com/gitlab-org/gitlab/-/issues/212532
+// [2]: https://gitlab.com/gitlab-org/gitlab/-/issues/213378
+// Further reference: https://github.com/facebook/jest/issues/3465
+
+export default fn => fn;