From 33d009a48f5fba91a5720544354500c51f1eff04 Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Fri, 18 May 2018 22:16:27 +0200 Subject: [PATCH] docs: add doc for "tryInterval" test utility --- test/javascript/lib/utils.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/javascript/lib/utils.js b/test/javascript/lib/utils.js index 0f269834a..cb0e5aa2e 100644 --- a/test/javascript/lib/utils.js +++ b/test/javascript/lib/utils.js @@ -1,5 +1,14 @@ (function (global, $) { + /** + * Try to catch the `do` function every `interval` delay, until it succedes + * (does not throw an error) or a given `timout` time passed. + * If a `then` function is passed, it is called after `do` succeded. + * If a `catch` function is passed, it is called after each time `do` fails. + * + * @param {object} opts + * @param {object} opts + */ global.tryInterval = function (opts) { var _opts = $.extend({}, opts); var totalTime = 0; -- 2.47.2