From bc764aeaacb079d2bdf035e4b357a3f06fc8a322 Mon Sep 17 00:00:00 2001 From: nkzawa Date: Thu, 3 Sep 2015 02:21:12 +0900 Subject: [PATCH] add a test for the case reconnection doesn't work --- test/connection.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/connection.js b/test/connection.js index ca72db1e..2fe201ac 100644 --- a/test/connection.js +++ b/test/connection.js @@ -250,6 +250,18 @@ describe('connection', function() { }); }); + it('should reconnect after stopping reconnection', function(done){ + var socket = io('/invalid', { forceNew: true, timeout: 0, reconnectionDelay: 10 }); + socket.once('reconnect_attempt', function() { + socket.on('reconnect_attempt', function() { + socket.disconnect(); + done(); + }); + socket.disconnect(); + socket.connect(); + }); + }); + it('should stop reconnecting on a socket and keep to reconnect on another', function(done){ var manager = io.Manager(); var socket1 = manager.socket('/');