MCPcopy Index your code
hub / github.com/TanStack/devtools / createConnectingWebSocketClass

Function createConnectingWebSocketClass

packages/event-bus/tests/client.test.ts:51–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
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() {
73 return class ThrowingWebSocket {

Callers 1

client.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected