We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5322e0d commit 0cc7e0aCopy full SHA for 0cc7e0a
tests/unit/util.js
@@ -1,7 +1,7 @@
1
import Vue from "vue";
2
3
export function later(delay = 0) {
4
- return new Promise(resolve => {
+ return new Promise((resolve) => {
5
if (typeof delay === "number") {
6
setTimeout(() => {
7
resolve();
@@ -13,3 +13,13 @@ export function later(delay = 0) {
13
}
14
});
15
16
+
17
+/*
18
+ * @mockScrollTo
19
+ * @desc mock scrollTo function
20
+ */
21
+export function mockScrollTo() {
22
+ const fn = jest.fn();
23
+ Element.prototype.scrollTo = fn;
24
+ return fn;
25
+}
0 commit comments