Skip to content

Commit

Permalink
test: added socket event reception test
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 18, 2012
1 parent 1d8a747 commit c929f8c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/socket.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,23 @@ describe('socket.io', function(){
});

describe('socket', function(){
it('should receive events', function(done){
var srv = http();
var sio = io(srv);
srv.listen(function(){
var socket = client(srv);
sio.on('connection', function(s){
s.on('random', function(a, b, c){
expect(a).to.be(1);
expect(b).to.be('2');
expect(c).to.eql([3]);
done();
});
socket.emit('random', 1, '2', [3]);
});
});
});

it('should receive message events through `send`', function(done){
var srv = http();
var sio = io(srv);
Expand Down

0 comments on commit c929f8c

Please sign in to comment.