()
| 34 | } |
| 35 | |
| 36 | function waitForPaint() { |
| 37 | return new Promise<void>((resolve) => { |
| 38 | let done = false |
| 39 | const finish = () => { |
| 40 | if (done) return |
| 41 | done = true |
| 42 | resolve() |
| 43 | } |
| 44 | const timer = setTimeout(finish, 50) |
| 45 | if (typeof requestAnimationFrame !== "function") return |
| 46 | requestAnimationFrame(() => { |
| 47 | setTimeout(() => { |
| 48 | clearTimeout(timer) |
| 49 | finish() |
| 50 | }, 0) |
| 51 | }) |
| 52 | }) |
| 53 | } |
| 54 | |
| 55 | function errors(list: PromiseSettledResult<unknown>[]) { |
| 56 | return list.filter((item): item is PromiseRejectedResult => item.status === "rejected").map((item) => item.reason) |
no test coverage detected