- makeWSClass(init: ((instance: MockWebSocket) => void)): {
CLOSED: number;
CLOSING: number;
CONNECTING: number;
OPEN: number;
prototype: WebSocket;
new (url: string | URL, protocols?: string | string[]): WebSocket;
}
-
Returns {
CLOSED: number;
CLOSING: number;
CONNECTING: number;
OPEN: number;
prototype: WebSocket;
new (url: string | URL, protocols?: string | string[]): WebSocket;
}
-
- new (url: string | URL, protocols?: string | string[]): WebSocket
-
Parameters
-
url: string | URL
-
Optional protocols: string | string[]
Returns WebSocket
-
Readonly CLOSED: number
-
Readonly CLOSING: number
-
Readonly CONNECTING: number
-
Readonly OPEN: number
-
prototype: WebSocket
Create and return a WebSocket class for testing that executes the given init function passing the instance once available.