Skip to content

Commit

Permalink
[test] fix tests for NodeJS v7 (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne authored Nov 3, 2016
1 parent 7cbdd5e commit 7c33b42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports.listen = function (opts, fn) {
opts = {};
}

var e = eio.listen(null, opts, function () {
var e = eio.listen(undefined, opts, function () {
fn(e.httpServer.address().port);
});

Expand Down
18 changes: 9 additions & 9 deletions test/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ describe('server', function () {
});

it('should arrive when binary data is sent as Buffer (ws)', function (done) {
var binaryData = Buffer(5);
var binaryData = new Buffer(5);
for (var i = 0; i < binaryData.length; i++) {
binaryData.writeInt8(i, i);
}
Expand All @@ -1242,7 +1242,7 @@ describe('server', function () {
});

it('should arrive when binary data sent as Buffer (polling)', function (done) {
var binaryData = Buffer(5);
var binaryData = new Buffer(5);
for (var i = 0; i < binaryData.length; i++) {
binaryData.writeInt8(i, i);
}
Expand All @@ -1269,7 +1269,7 @@ describe('server', function () {
});

it('should arrive as ArrayBuffer if requested when binary data sent as Buffer (ws)', function (done) {
var binaryData = Buffer(5);
var binaryData = new Buffer(5);
for (var i = 0; i < binaryData.length; i++) {
binaryData.writeInt8(i, i);
}
Expand Down Expand Up @@ -1298,7 +1298,7 @@ describe('server', function () {
});

it('should arrive as ArrayBuffer if requested when binary data sent as Buffer (polling)', function (done) {
var binaryData = Buffer(5);
var binaryData = new Buffer(5);
for (var i = 0; i < binaryData.length; i++) {
binaryData.writeInt8(i, i);
}
Expand Down Expand Up @@ -1454,7 +1454,7 @@ describe('server', function () {

var engine = eio({ transports: ['polling'], allowUpgrades: false });
engine.attach(srv);
srv.listen(null, function () {
srv.listen(function () {
var port = srv.address().port;
var socket = new eioc.Socket('https://localhost:%d'.s(port), opts);

Expand Down Expand Up @@ -1492,7 +1492,7 @@ describe('server', function () {

var engine = eio({ transports: ['polling'], allowUpgrades: false });
engine.attach(srv);
srv.listen(null, function () {
srv.listen(function () {
var port = srv.address().port;
var socket = new eioc.Socket('https://localhost:%d'.s(port), opts);

Expand Down Expand Up @@ -1532,7 +1532,7 @@ describe('server', function () {

var engine = eio({ transports: ['websocket'], allowUpgrades: false });
engine.attach(srv);
srv.listen(null, function () {
srv.listen(function () {
var port = srv.address().port;
var socket = new eioc.Socket('https://localhost:%d'.s(port), opts);

Expand Down Expand Up @@ -1572,7 +1572,7 @@ describe('server', function () {

var engine = eio({ transports: ['polling'], allowUpgrades: false });
engine.attach(srv);
srv.listen(null, function () {
srv.listen(function () {
var port = srv.address().port;
var socket = new eioc.Socket('https://localhost:%d'.s(port), opts);

Expand Down Expand Up @@ -1612,7 +1612,7 @@ describe('server', function () {

var engine = eio({ transports: ['websocket'], allowUpgrades: false });
engine.attach(srv);
srv.listen(null, function () {
srv.listen(function () {
var port = srv.address().port;
var socket = new eioc.Socket('https://localhost:%d'.s(port), opts);

Expand Down

0 comments on commit 7c33b42

Please sign in to comment.