Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test: added room tracking test

  • Loading branch information...
commit 46d069b3ccf3060c6d4921131fc26f7f482c56b9 1 parent 708af3f
@rauchg rauchg authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 test/socket.io.js
View
21 test/socket.io.js
@@ -515,5 +515,26 @@ describe('socket.io', function(){
});
});
});
+
+ it('keeps track of 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.rooms).to.eql([s.id, 'a']);
+ s.join('b', function(){
+ expect(s.rooms).to.eql([s.id, 'a', 'b']);
+ s.leave('b', function(){
+ expect(s.rooms).to.eql([s.id, 'a']);
+ done();
+ });
+ });
+ });
+ });
+ });
+ });
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.