Skip to content

Commit 3512221

Browse files
committed
fix test
1 parent 933c265 commit 3512221

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/v1/internal/browser/browser-channel.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ export default class WebSocketChannel {
3131
* @param {ChannelConfig} config - configuration for this channel.
3232
* @param {function(): string} protocolSupplier - function that detects protocol of the web page. Should only be used in tests.
3333
*/
34-
constructor (config, protocolSupplier = detectWebPageProtocol) {
34+
constructor (
35+
config,
36+
protocolSupplier = detectWebPageProtocol,
37+
socketFactory = createWebSocket
38+
) {
3539
this._open = true
3640
this._pending = []
3741
this._error = null
@@ -44,7 +48,7 @@ export default class WebSocketChannel {
4448
return
4549
}
4650

47-
this._ws = createWebSocket(scheme, config.address)
51+
this._ws = socketFactory(scheme, config.address)
4852
this._ws.binaryType = 'arraybuffer'
4953

5054
const self = this

0 commit comments

Comments
 (0)