From 9319a77da187cdb360e398aebf99a29cd1bdc377 Mon Sep 17 00:00:00 2001 From: sonnym Date: Tue, 8 May 2012 23:12:04 -0400 Subject: [PATCH 1/2] update redis and should; fix tests the motivation behind these changes is that in upcoming versions of node, sys will finally be deprecated --- package.json | 6 +++--- test/parser.test.js | 12 ++++++------ test/static.test.js | 2 +- test/transports.flashsocket.test.js | 12 ++++++------ test/transports.xhr-polling.test.js | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 53044c76b9..bccf54064d 100644 --- a/package.json +++ b/package.json @@ -18,17 +18,17 @@ , "dependencies": { "socket.io-client": "0.9.6" , "policyfile": "0.0.4" - , "redis": "0.6.7" + , "redis": "0.7.2" } , "devDependencies": { "expresso": "0.9.2" - , "should": "0.0.4" + , "should": "0.6.3" , "benchmark": "0.2.2" , "microtime": "0.1.3-1" , "colors": "0.5.1" } , "main": "index" - , "engines": { "node": ">= 0.4.0" } + , "engines": { "node": ">= 0.7.0" } , "scripts": { "test": "make test" } diff --git a/test/parser.test.js b/test/parser.test.js index 13bf4cf99a..0d6eb88a33 100644 --- a/test/parser.test.js +++ b/test/parser.test.js @@ -95,7 +95,7 @@ module.exports = { 'decoding json packet with message id and ack data': function () { parser.decodePacket('4:1+::{"a":"b"}').should.eql({ type: 'json' - , id: 1 + , id: '1' , ack: 'data' , endpoint: '' , data: { a: 'b' } @@ -114,7 +114,7 @@ module.exports = { 'decoding an event packet with message id and ack': function () { parser.decodePacket('5:1+::{"name":"tobi"}').should.eql({ type: 'event' - , id: 1 + , id: '1' , ack: 'data' , endpoint: '' , name: 'tobi' @@ -143,7 +143,7 @@ module.exports = { 'decoding a message packet with id and endpoint': function () { parser.decodePacket('3:5:/tobi').should.eql({ type: 'message' - , id: 5 + , id: '5' , ack: true , endpoint: '/tobi' , data: '' @@ -245,7 +245,7 @@ module.exports = { 'encoding json packet with message id and ack data': function () { parser.encodePacket({ type: 'json' - , id: 1 + , id: '1' , ack: 'data' , endpoint: '' , data: { a: 'b' } @@ -264,7 +264,7 @@ module.exports = { 'encoding an event packet with message id and ack': function () { parser.encodePacket({ type: 'event' - , id: 1 + , id: '1' , ack: 'data' , endpoint: '' , name: 'tobi' @@ -292,7 +292,7 @@ module.exports = { 'encoding a message packet with id and endpoint': function () { parser.encodePacket({ type: 'message' - , id: 5 + , id: '5' , ack: true , endpoint: '/tobi' , data: '' diff --git a/test/static.test.js b/test/static.test.js index bc97d35720..473c7ec274 100644 --- a/test/static.test.js +++ b/test/static.test.js @@ -452,7 +452,7 @@ module.exports = { cl.get('/socket.io/socket.io.js', function (res, data) { res.headers['content-type'].should.eql('application/javascript'); - res.headers['content-length'].should.eql(13); + res.headers['content-length'].should.eql('13'); res.headers.etag.should.eql('1.0'); data.should.eql('custom_client'); diff --git a/test/transports.flashsocket.test.js b/test/transports.flashsocket.test.js index f3753713e7..d13a1abe2e 100644 --- a/test/transports.flashsocket.test.js +++ b/test/transports.flashsocket.test.js @@ -104,7 +104,7 @@ module.exports = { netConnection(port, function (err, data){ should.strictEqual(err, null); - data.toString().should.include.string(''); + data.toString().should.match(//); this.destroy(); io.flashPolicyServer.close(); @@ -133,7 +133,7 @@ module.exports = { netConnection(next, function (err, data){ should.strictEqual(err, null); - data.toString().should.include.string(''); + data.toString().should.match(//); this.destroy(); io.flashPolicyServer.close(); @@ -152,14 +152,14 @@ module.exports = { var server = io.flashPolicyServer; - server.origins.should.contain('google.com:80'); + server.origins.should.include('google.com:80'); server.origins.should.not.contain('*.*'); io.set('origins', ['foo.bar:80', 'socket.io:1337']); server.origins.should.not.contain('google.com:80'); - server.origins.should.contain('foo.bar:80'); - server.origins.should.contain('socket.io:1337'); - server.buffer.toString('utf8').should.include.string('socket.io'); + server.origins.should.include('foo.bar:80'); + server.origins.should.include('socket.io:1337'); + server.buffer.toString('utf8').should.match(/socket\.io/); io.flashPolicyServer.close(); done(); diff --git a/test/transports.xhr-polling.test.js b/test/transports.xhr-polling.test.js index 9a63c2d026..c8ef710e91 100644 --- a/test/transports.xhr-polling.test.js +++ b/test/transports.xhr-polling.test.js @@ -1351,7 +1351,7 @@ module.exports = { msgs.should.have.length(1); msgs[0].should.eql({ type: 'ack' - , ackId: 1 + , ackId: '1' , endpoint: '' , args: [] }); From 05c99cab9f6d6a50493ed4ef538e3bef9745e0c4 Mon Sep 17 00:00:00 2001 From: sonnym Date: Tue, 8 May 2012 23:41:17 -0400 Subject: [PATCH 2/2] Revert "update redis and should; fix tests" This reverts commit 9319a77da187cdb360e398aebf99a29cd1bdc377 partially so as to not update the supported engines --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bccf54064d..94d7c54a8e 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ , "colors": "0.5.1" } , "main": "index" - , "engines": { "node": ">= 0.7.0" } + , "engines": { "node": ">= 0.4.0" } , "scripts": { "test": "make test" }