From 204576c0067166bb914ea0d2710cbee04f30fb2a Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Sun, 26 Feb 2012 21:51:22 -0300 Subject: [PATCH] Make these 2 tests work both on 0.4 and 0.6 --- test/transports.websocket.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/transports.websocket.test.js b/test/transports.websocket.test.js index 298c4b4cbc..97f871db4f 100644 --- a/test/transports.websocket.test.js +++ b/test/transports.websocket.test.js @@ -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; @@ -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;