Create a web WebSocket and add it to the context.
( mockCtx: ReturnType<typeof createMockCtx>, connectionId = 'web-1', subscribedSessions: string[] = [] )
| 166 | }; |
| 167 | } |
| 168 | |
| 169 | /** Drain microtasks so waitUntil-scheduled async IIFEs settle. */ |
| 170 | async function flushAsync(): Promise<void> { |
| 171 | await new Promise<void>(resolve => { |
| 172 | setTimeout(resolve, 0); |
| 173 | }); |
| 174 | await new Promise<void>(resolve => { |
| 175 | setTimeout(resolve, 0); |
| 176 | }); |
| 177 | } |
| 178 | |
| 179 | // --------------------------------------------------------------------------- |
| 180 | // Helpers |
no test coverage detected