mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
add a test for the case reconnection doesn't work
This commit is contained in:
@@ -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('/');
|
||||
|
||||
Reference in New Issue
Block a user