()
| 304 | * Reset all module-level state. Only intended for use in tests. |
| 305 | */ |
| 306 | export function resetForTesting(): void { |
| 307 | if (state.pingInterval) { |
| 308 | clearInterval(state.pingInterval) |
| 309 | state.pingInterval = null |
| 310 | } |
| 311 | state.client = null |
| 312 | state.pingFailures = 0 |
| 313 | state.pingInFlight = false |
| 314 | state.reconnectListeners.length = 0 |
| 315 | } |