Builds the WebSocket constructor used by the mock host. The returned class is compatible with
connectWebSocket's webSocketConstructor param: it opens via queueMicrotask, fires open,
message, close, and error events into the client's listener API, and dispatches messages
sent from the client into the user's declared mock implementations. Extracted from
createMockHost so it can be reused independently and so the closure-captured api/context
resolver are explicit factory inputs rather than implicit captures.
Builds the WebSocket constructor used by the mock host. The returned class is compatible with
connectWebSocket'swebSocketConstructorparam: it opens viaqueueMicrotask, firesopen,message,close, anderrorevents into the client's listener API, and dispatches messages sent from the client into the user's declared mock implementations. Extracted fromcreateMockHostso it can be reused independently and so the closure-capturedapi/contextresolver are explicit factory inputs rather than implicit captures.