()
| 18 | |
| 19 | const pendingTimers: any[] = []; |
| 20 | export function clearPendingTimers() { |
| 21 | while (pendingTimers.length) { |
| 22 | const timer = pendingTimers.shift(); |
| 23 | try { |
| 24 | clearTimeout(timer); |
| 25 | } catch { |
| 26 | // Noop. |
| 27 | } |
| 28 | try { |
| 29 | clearInterval(timer); |
| 30 | } catch { |
| 31 | // Noop. |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Wait for a condition to be fulfilled within a timeout. |
no test coverage detected