()
| 58 | } |
| 59 | |
| 60 | async flush(): Promise<void> { |
| 61 | const allPending = Array.from(this.pending.values()).map((pending) => pending.promise); |
| 62 | |
| 63 | for (const [req, {resolve}] of this.pending) { |
| 64 | resolve(this.prepareResponse(req)); |
| 65 | } |
| 66 | this.pending.clear(); |
| 67 | |
| 68 | await Promise.all(allPending); |
| 69 | await flushMicrotasks(); |
| 70 | } |
| 71 | |
| 72 | protected abstract prepareResponse(request: T): R; |
| 73 | } |
nothing calls this directly
no test coverage detected