Version 1
[yaffs-website] / node_modules / phridge / test / helpers / slow.js
diff --git a/node_modules/phridge/test/helpers/slow.js b/node_modules/phridge/test/helpers/slow.js
new file mode 100644 (file)
index 0000000..c6db249
--- /dev/null
@@ -0,0 +1,31 @@
+"use strict";
+
+/**
+ * @param {function} fn
+ * @returns {function}
+ */
+function slow(fn) {
+    if (fn.length === 1) {
+        /**
+         * @this Runner
+         * @param {function} done
+         * @returns {*}
+         */
+        return function (done) {
+            this.slow(2000);
+            this.timeout(15000);
+            return fn.apply(this, arguments);
+        };
+    }
+    /**
+     * @this Runner
+     * @returns {*}
+     */
+    return function () {
+        this.slow(2000);
+        this.timeout(15000);
+        return fn.apply(this, arguments);
+    };
+}
+
+module.exports = slow;