Files
appium/test/helpers/repeat.js
Jonathan Lipps 4b73ef93cf allow pushStrings to work with 'app' as package, not just file
fix #2749 and add tests
also fix tryNTimes, I think it was vacuously succeeding all the time
(cc @sebv)
2014-06-05 17:09:48 -07:00

12 lines
231 B
JavaScript

"use strict";
var tryNTimes = function (n, fn) {
if (n === 1) return fn();
return fn().catch(function () {
return tryNTimes(n - 1, fn);
});
};
exports.tryNTimes = tryNTimes;
exports.try3Times = tryNTimes.bind(null, 3);