| 462 | } |
| 463 | |
| 464 | class FakeWebSocket extends EventEmitter { |
| 465 | static instances: FakeWebSocket[] = []; |
| 466 | |
| 467 | readonly sent: string[] = []; |
| 468 | |
| 469 | constructor(readonly url: string) { |
| 470 | super(); |
| 471 | FakeWebSocket.instances.push(this); |
| 472 | queueMicrotask(() => this.emit('open')); |
| 473 | } |
| 474 | |
| 475 | send(data: string): void { |
| 476 | this.sent.push(data); |
| 477 | } |
| 478 | |
| 479 | close(): void { |
| 480 | this.emit('close', 1000, ''); |
| 481 | } |
| 482 | } |
nothing calls this directly
no outgoing calls
no test coverage detected