From 00f6ddc9e6a0ef52b8d8e40aa2f2b3169e000942 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 30 Jul 2015 10:32:25 -0400 Subject: [PATCH] Fix failing test It only makes sense to send data on a websocket if the readyState is equal to 1. --- tests/test.websock.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test.websock.js b/tests/test.websock.js index 953a526..f708e04 100644 --- a/tests/test.websock.js +++ b/tests/test.websock.js @@ -173,6 +173,7 @@ describe('Websock', function() { it('should actually send on the websocket if the websocket does not have too much buffered', function () { sock.maxBufferedAmount = 10; sock._websocket.bufferedAmount = 8; + sock._websocket.readyState = WebSocket.OPEN sock._sQ = new Uint8Array([1, 2, 3]); sock._sQlen = 3; var encoded = sock._encode_message();