mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
28 lines
694 B
JavaScript
28 lines
694 B
JavaScript
|
|
describe('Socket', function () {
|
|
|
|
describe('filterUpgrades', function () {
|
|
it('should return only available transports', function () {
|
|
var socket = new eio.Socket({'transports': ['polling']});
|
|
expect(socket.filterUpgrades(['polling','websocket'])).to.eql(['polling']);
|
|
});
|
|
});
|
|
|
|
describe('socketClosing', function () {
|
|
it('should not emit close on incorrect connection', function (done) {
|
|
var socket = new eio.Socket('ws://localhost:8080');
|
|
var closed = false;
|
|
|
|
socket.on('close', function () {
|
|
closed = true;
|
|
});
|
|
|
|
setTimeout(function() {
|
|
expect(closed).to.be(false);
|
|
done();
|
|
}, 200);
|
|
});
|
|
});
|
|
|
|
});
|