(ws: WebSocket, event: Event, successful = true)
| 123 | } |
| 124 | |
| 125 | export async function sendEvent(ws: WebSocket, event: Event, successful = true) { |
| 126 | const result = await publishEvent(ws, event) |
| 127 | |
| 128 | if (result[2] !== successful) { |
| 129 | throw new Error(result[3]) |
| 130 | } |
| 131 | |
| 132 | return result |
| 133 | } |
| 134 | |
| 135 | export async function waitForNextEvent(ws: WebSocket, subscription: string, content?: string): Promise<Event> { |
| 136 | return new Promise((resolve, reject) => { |
no test coverage detected