Skip to content

Commit

Permalink
Make these 2 tests work both on 0.4 and 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Feb 27, 2012
1 parent 66ac425 commit 204576c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/transports.websocket.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module.exports = {
var url = '/socket.io/' + sio.protocol + '/websocket/' + sid;
var req = cl.get(url, {headers: headers}, function (res, data) {});
var closed = false;
req.socket.on('close', function() {
(req.socket || req).on('close', function() {
if (closed) return;
closed = true;
notConnected.should.be.true;
Expand Down Expand Up @@ -169,7 +169,7 @@ module.exports = {
var url = '/socket.io/' + sio.protocol + '/websocket/' + sid;
var req = cl.get(url, {headers: headers}, function (res, data) {});
var closed = false;
req.socket.on('close', function() {
(req.socket || req).on('close', function() {
if (closed) return;
closed = true;
notConnected.should.be.true;
Expand Down

0 comments on commit 204576c

Please sign in to comment.