diff --git a/lib/client/connection.js b/lib/client/connection.js index f48d06f13..f4cc298e6 100644 --- a/lib/client/connection.js +++ b/lib/client/connection.js @@ -88,7 +88,7 @@ Connection.prototype.bindToSocket = function(socket) { this.socket = socket; - // State of the connection. The correspoding events are emmited when this changes + // State of the connection. The corresponding events are emitted when this changes // // - 'connecting' The connection is still being established, or we are still // waiting on the server to send us the initialization message diff --git a/test/client/connection.js b/test/client/connection.js index 8d22e4753..677e87e44 100644 --- a/test/client/connection.js +++ b/test/client/connection.js @@ -92,6 +92,7 @@ describe('client connection', function() { }); describe('state management using setSocket', function() { + it('initial connection.state is connecting, if socket.readyState is CONNECTING', function () { // https://html.spec.whatwg.org/multipage/web-sockets.html#dom-websocket-connecting var socket = {readyState: 0};