Skip to content

Commit 3740f39

Browse files
authored
fix: avoid starting a timeout if the timer was resolved immediately (#14642)
1 parent b4e3884 commit 3740f39

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/webdriverio/src/utils/Timer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class Timer {
5353
this._timeoutId = setTimeout(this._tick.bind(this), this._delay)
5454
}
5555

56+
if (this._wasConditionExecuted()) {
57+
return
58+
}
59+
5660
this._mainTimeoutId = setTimeout(() => {
5761
/**
5862
* make sure that condition was executed at least once

0 commit comments

Comments
 (0)