mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Merge pull request #1792 from rase-/add/autopruning-test
Add room autopruning test
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
"engine.io": "1.4.0",
|
||||
"socket.io-parser": "2.2.1",
|
||||
"socket.io-client": "1.1.0",
|
||||
"socket.io-adapter": "0.2.0",
|
||||
"socket.io-adapter": "Automattic/socket.io-adapter#006f19",
|
||||
"has-binary-data": "0.1.3",
|
||||
"debug": "0.7.4"
|
||||
},
|
||||
|
||||
@@ -1291,6 +1291,24 @@ describe('socket.io', function(){
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('deletes empty rooms', function(done) {
|
||||
var srv = http();
|
||||
var sio = io(srv);
|
||||
|
||||
srv.listen(function(){
|
||||
var socket = client(srv);
|
||||
sio.on('connection', function(s){
|
||||
s.join('a', function(){
|
||||
expect(s.nsp.adapter.rooms).to.have.key('a');
|
||||
s.leave('a', function(){
|
||||
expect(s.nsp.adapter.rooms).to.not.have.key('a');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('middleware', function(done){
|
||||
|
||||
Reference in New Issue
Block a user