mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Added volatile message tests for htmlfile.
This commit is contained in:
@@ -307,6 +307,38 @@ module.exports = {
|
||||
}, 10);
|
||||
}, 10);
|
||||
});
|
||||
},
|
||||
|
||||
'test sending deliverable volatile messages': function (done) {
|
||||
var port = ++ports
|
||||
, cl = client(port)
|
||||
, io = create(cl)
|
||||
, messaged = false;
|
||||
|
||||
io.configure(function () {
|
||||
io.set('close timeout', 0);
|
||||
});
|
||||
|
||||
io.sockets.on('connection', function (socket) {
|
||||
socket.volatile.send('woot');
|
||||
|
||||
socket.on('disconnect', function () {
|
||||
io.server.close();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
cl.handshake(function (sid) {
|
||||
cl.data('/socket.io/{protocol}/htmlfile/' + sid, function (msgs) {
|
||||
msgs.should.have.length(1);
|
||||
msgs[0].should.eql({
|
||||
type: 'message'
|
||||
, data: 'woot'
|
||||
, endpoint: ''
|
||||
});
|
||||
cl.end();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user