@wdio/sync
Advanced tools
Comparing version 5.16.11 to 5.16.12
@@ -25,3 +25,3 @@ "use strict"; | ||
}); | ||
exports.executeAsync = exports.executeSync = void 0; | ||
exports.executeSync = void 0; | ||
@@ -42,2 +42,3 @@ var _fibers = _interopRequireDefault(require("./fibers")); | ||
delete global.browser._NOT_FIBER; | ||
this.retries = retries.attempts; | ||
@@ -57,3 +58,3 @@ try { | ||
retries.attempts++; | ||
return await executeSync(fn, retries, args); | ||
return await executeSync.call(this, fn, retries, args); | ||
} | ||
@@ -72,23 +73,4 @@ | ||
const executeAsync = async function (fn, retries, args = []) { | ||
try { | ||
return await fn.apply(this, args); | ||
} catch (e) { | ||
if (retries.limit > retries.attempts) { | ||
retries.attempts++; | ||
return await executeAsync(fn, retries, args); | ||
} | ||
if (e.stack) { | ||
e.stack = e.stack.split('\n').filter(_constants.STACKTRACE_FILTER_FN).join('\n'); | ||
} | ||
throw e; | ||
} | ||
}; | ||
exports.executeAsync = executeAsync; | ||
function runSync(fn, repeatTest = 0, args = []) { | ||
return (resolve, reject) => (0, _fibers.default)(() => executeSync.call(this, fn, repeatTest, args).then(resolve, reject)).run(); | ||
} |
{ | ||
"name": "@wdio/sync", | ||
"version": "5.16.11", | ||
"version": "5.16.12", | ||
"description": "A WebdriverIO plugin. Helper module to run WebdriverIO commands synchronously", | ||
@@ -46,3 +46,3 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
}, | ||
"gitHead": "ebea222f90021b0a76b475fcd70a5e1f8ec4dba8" | ||
"gitHead": "6bb593e8170fd9f7032fd0d1767147ce167d4c89" | ||
} |
39288
1027