UNPKG

cybernaut

Version:

Reliable, zero configuration end-to-end testing in BDD-style.

23 lines 668 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const utils_1 = require("./utils"); function run(step, retries, retryDelay, attempts = 1) { return tslib_1.__awaiter(this, void 0, void 0, function* () { try { yield step(); return attempts; } catch (e) { if (retries >= attempts) { yield utils_1.sleep(retryDelay); return run(step, retries, retryDelay, attempts + 1); } else { throw e; } } }); } exports.run = run; //# sourceMappingURL=step.js.map