Finished last websocket test.

This commit is contained in:
Guillermo Rauch
2011-05-22 20:17:44 -07:00
parent a2c30a1416
commit 334c00f2c0

View File

@@ -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();
});
});
}
};