diff --git a/lib/predictions.js b/lib/predictions.js index 3ec8546..c5ffda9 100644 --- a/lib/predictions.js +++ b/lib/predictions.js @@ -21,6 +21,11 @@ async function createPrediction(options) { if (wait) { const { maxAttempts, interval } = wait; + + // eslint-disable-next-line no-promise-executor-return + const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); + await sleep(interval || 250); + return this.wait(await prediction, { maxAttempts, interval }); }