(event, {catchErrors = true} = {})
| 10 | const eventResponses = new WeakMap(); |
| 11 | |
| 12 | export const eventDoneWaiting = async (event, {catchErrors = true} = {}) => { |
| 13 | const promises = extendLifetimePromises.get(event); |
| 14 | let promise; |
| 15 | |
| 16 | while ((promise = promises.shift())) { |
| 17 | // Ignore errors by default; |
| 18 | if (catchErrors) { |
| 19 | promise = promise.catch((e) => e); |
| 20 | } |
| 21 | await promise; |
| 22 | } |
| 23 | }; |
| 24 | |
| 25 | export const spyOnEvent = (event) => { |
| 26 | const promises = []; |
no test coverage detected