(url: string)
| 447 | listeners: Record<string, Array<(event: unknown) => void>> = {}; |
| 448 | |
| 449 | constructor(url: string) { |
| 450 | this.url = url; |
| 451 | window.setTimeout(() => { |
| 452 | this.readyState = MockWebSocket.OPEN; |
| 453 | this.emit("open", {}); |
| 454 | }, 10); |
| 455 | } |
| 456 | |
| 457 | addEventListener(type: string, listener: (event: unknown) => void) { |
| 458 | if (!this.listeners[type]) { |