Created
October 19, 2014 02:09
-
-
Save nkzawa/6d69f5b7fd9f48832cc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should fire connect event on reconnect', function(done){ | |
var socket = io({ forceNew: true }); | |
var count = 0; | |
socket.on('connect', function() { | |
socket.on('myevent', function() {}); | |
if (++count === 1) return; | |
expect(socket.listeners('myevent')).to.have.length(2); | |
socket.disconnect(); | |
done(); | |
}); | |
setTimeout(function() { | |
socket.io.engine.close(); | |
}, 500); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment