Skip to content

Commit a72b7e0

Browse files
committed
test: add unit test for idleTimer
1 parent 6105e5d commit a72b7e0

2 files changed

Lines changed: 556 additions & 2 deletions

File tree

packages/vscode-wdio-server/src/idleMonitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export class WorkerIdleMonitor extends EventEmitter implements IWorkerIdleMonito
9191
return
9292
}
9393

94-
this._pauseCounter--
95-
if (this._pauseCounter < 1) {
94+
this._pauseCounter = this._pauseCounter - 1 < 0 ? 0 : this._pauseCounter - 1
95+
if (this._pauseCounter < 1 && !this._timer) {
9696
this.startTimer()
9797
log.trace(`[${this._workerId}] IdleMonitor timer resumed`)
9898
}

0 commit comments

Comments
 (0)