mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Finished last websocket test.
This commit is contained in:
@@ -398,6 +398,41 @@ module.exports = {
|
||||
ws.finishClose();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
'test sending deliverable volatile events': function (done) {
|
||||
var cl = client(++ports)
|
||||
, io = create(cl)
|
||||
, messaged = false;
|
||||
|
||||
io.configure(function () {
|
||||
io.set('close timeout', .05);
|
||||
});
|
||||
|
||||
io.sockets.on('connection', function (socket) {
|
||||
socket.volatile.emit('tobi');
|
||||
|
||||
socket.on('disconnect', function () {
|
||||
messaged.should.be.true;
|
||||
cl.end();
|
||||
io.server.close();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
cl.handshake(function (sid) {
|
||||
var ws = websocket(cl, sid);
|
||||
ws.on('message', function (msg) {
|
||||
msg.should.eql({
|
||||
type: 'event'
|
||||
, name: 'tobi'
|
||||
, endpoint: ''
|
||||
, args: []
|
||||
});
|
||||
messaged = true;
|
||||
ws.finishClose();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user