MCPcopy Create free account
hub / github.com/TanStack/devtools / ConnectingWebSocket

Class ConnectingWebSocket

packages/event-bus/tests/client.test.ts:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51function createConnectingWebSocketClass() {
52 // Starts in CONNECTING state; tests flip readyState and fire onopen manually.
53 return class ConnectingWebSocket {
54 static CONNECTING = 0
55 static OPEN = 1
56 static CLOSED = 3
57 url: string
58 readyState = 0 // CONNECTING
59 onopen: any = null
60 onmessage: any = null
61 onclose: any = null
62 onerror: any = null
63 send = vi.fn()
64 close = vi.fn()
65 constructor(url: string) {
66 this.url = url
67 mockWebSocketInstances.push(this)
68 }
69 }
70}
71
72function createThrowingWebSocketClass() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected