Skip to content

Commit

Permalink
[chore] Bump dependencies (#549)
Browse files Browse the repository at this point in the history
- debug to version 3.1.0
- babel-eslint to version 8.0.2
- mocha to version 4.0.1
- superagent to version 3.8.1
  • Loading branch information
darrachequesne committed Feb 18, 2018
1 parent ea318b8 commit 0d4e79e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 27 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"dependencies": {
"accepts": "~1.3.4",
"base64id": "1.0.0",
"debug": "~2.6.9",
"debug": "~3.1.0",
"engine.io-parser": "~2.1.0",
"ws": "~3.3.1",
"cookie": "0.3.1"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
"babel-eslint": "^8.0.2",
"babel-preset-es2015": "^6.24.0",
"engine.io-client": "3.1.4",
"eslint": "^4.5.0",
Expand All @@ -43,9 +43,9 @@
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"expect.js": "^0.3.1",
"mocha": "^3.2.0",
"mocha": "^4.0.1",
"s": "0.1.1",
"superagent": "0.15.4"
"superagent": "^3.8.1"
},
"optionalDependencies": {
"uws": "~9.14.0"
Expand Down
12 changes: 8 additions & 4 deletions test/engine.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ describe('engine', function () {
describe('listen', function () {
it('should open a http server that returns 501', function (done) {
listen(function (port) {
request.get('http://localhost:%d/'.s(port), function (res) {
request.get('http://localhost:%d/'.s(port), function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(501);
done();
});
Expand Down Expand Up @@ -65,7 +66,8 @@ describe('engine', function () {

server.listen(function () {
var uri = 'http://localhost:%d/engine.io/default/'.s(server.address().port);
request.get(uri, function (res) {
request.get(uri, function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(400);
expect(res.body.code).to.be(0);
expect(res.body.message).to.be('Transport unknown');
Expand Down Expand Up @@ -216,11 +218,13 @@ describe('engine', function () {

server.listen(function () {
var port = server.address().port;
request.get('http://localhost:%d/engine.io/default/'.s(port), function (res) {
request.get('http://localhost:%d/engine.io/default/'.s(port), function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(400);
expect(res.body.code).to.be(0);
expect(res.body.message).to.be('Transport unknown');
request.get('http://localhost:%d/test'.s(port), function (res) {
request.get('http://localhost:%d/test'.s(port), function (err, res) {
expect(err).to.be(null);
expect(res.status).to.be(200);
expect(listeners).to.eql(2);
server.once('close', done);
Expand Down
3 changes: 2 additions & 1 deletion test/jsonp.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ describe('JSONP', function () {
});

script.__defineSetter__('src', function (uri) {
request.get(uri).end(function (res) {
request.get(uri).end(function (err, res) {
expect(err).to.be(null);
eval(res.text); // eslint-disable-line no-eval
});
});
Expand Down
53 changes: 35 additions & 18 deletions test/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ describe('server', function () {
listen(function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'tobi' }) // no tobi transport - outrageous
.end(function (res) {
.end(function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(400);
expect(res.body.code).to.be(0);
expect(res.body.message).to.be('Transport unknown');
Expand All @@ -51,7 +52,8 @@ describe('server', function () {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.set('Origin', 'http://engine.io')
.query({ transport: 'constructor' })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(400);
expect(res.body.code).to.be(0);
expect(res.body.message).to.be('Transport unknown');
Expand All @@ -67,7 +69,8 @@ describe('server', function () {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.set('Origin', 'http://engine.io')
.query({ transport: 'polling', sid: 'test' })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(400);
expect(res.body.code).to.be(1);
expect(res.body.message).to.be('Session ID unknown');
Expand All @@ -83,7 +86,8 @@ describe('server', function () {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.set('Origin', 'http://engine.io')
.query({ transport: 'polling' })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(403);
expect(res.body.code).to.be(4);
expect(res.body.message).to.be('Thou shall not pass');
Expand All @@ -109,7 +113,8 @@ describe('server', function () {
listen(function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling', b64: 1 })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
// hack-obtain sid
var sid = res.text.match(/"sid":"([^"]+)"/)[1];
expect(res.headers['set-cookie'][0]).to.be('io=' + sid + '; Path=/; HttpOnly');
Expand All @@ -122,7 +127,8 @@ describe('server', function () {
listen({ cookie: 'woot' }, function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling', b64: 1 })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
var sid = res.text.match(/"sid":"([^"]+)"/)[1];
expect(res.headers['set-cookie'][0]).to.be('woot=' + sid + '; Path=/; HttpOnly');
done();
Expand All @@ -134,7 +140,8 @@ describe('server', function () {
listen({ cookiePath: '/custom' }, function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling', b64: 1 })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
var sid = res.text.match(/"sid":"([^"]+)"/)[1];
expect(res.headers['set-cookie'][0]).to.be('io=' + sid + '; Path=/custom; HttpOnly');
done();
Expand All @@ -146,7 +153,8 @@ describe('server', function () {
listen({ cookiePath: false }, function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling', b64: 1 })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
var sid = res.text.match(/"sid":"([^"]+)"/)[1];
expect(res.headers['set-cookie'][0]).to.be('io=' + sid);
done();
Expand All @@ -158,7 +166,8 @@ describe('server', function () {
listen({ cookieHttpOnly: true }, function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling', b64: 1 })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
var sid = res.text.match(/"sid":"([^"]+)"/)[1];
expect(res.headers['set-cookie'][0]).to.be('io=' + sid + '; Path=/; HttpOnly');
done();
Expand All @@ -170,7 +179,8 @@ describe('server', function () {
listen({ cookieHttpOnly: true, cookiePath: false }, function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling', b64: 1 })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
var sid = res.text.match(/"sid":"([^"]+)"/)[1];
expect(res.headers['set-cookie'][0]).to.be('io=' + sid);
done();
Expand All @@ -182,7 +192,8 @@ describe('server', function () {
listen({ cookieHttpOnly: false }, function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling', b64: 1 })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
var sid = res.text.match(/"sid":"([^"]+)"/)[1];
expect(res.headers['set-cookie'][0]).to.be('io=' + sid + '; Path=/');
done();
Expand All @@ -194,7 +205,8 @@ describe('server', function () {
listen({ cookieHttpOnly: 'no' }, function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling', b64: 1 })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
var sid = res.text.match(/"sid":"([^"]+)"/)[1];
expect(res.headers['set-cookie'][0]).to.be('io=' + sid + '; Path=/; HttpOnly');
done();
Expand All @@ -206,7 +218,8 @@ describe('server', function () {
listen({ cookie: false }, function (port) {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.query({ transport: 'polling' })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
expect(res.headers['set-cookie']).to.be(undefined);
done();
});
Expand Down Expand Up @@ -356,7 +369,7 @@ describe('server', function () {
.set({ connection: 'close' })
.query({ transport: 'websocket', sid: socket.id })
.end(function (err, res) {
expect(err).to.be(null);
expect(err).to.be.an(Error);
expect(res.status).to.be(400);
expect(res.body.code).to.be(3);
socket.send('echo');
Expand Down Expand Up @@ -397,7 +410,8 @@ describe('server', function () {
request.get('http://localhost:%d/engine.io/default/'.s(port))
.set('Origin', 'http://engine.io')
.query({ transport: 'websocket' })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(400);
expect(res.body.code).to.be(3);
expect(res.body.message).to.be('Bad request');
Expand Down Expand Up @@ -2579,7 +2593,8 @@ describe('server', function () {
request.options('http://localhost:%d/engine.io/default/'.s(port))
.set('Origin', 'http://engine.io')
.query({ transport: 'polling' })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(400);
expect(res.body.code).to.be(2);
expect(res.body.message).to.be('Bad handshake method');
Expand All @@ -2595,7 +2610,8 @@ describe('server', function () {
request.options('http://localhost:%d/engine.io/default/'.s(port))
.set('Origin', 'http://engine.io')
.query({ transport: 'polling' })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be.an(Error);
expect(res.status).to.be(501);
expect(res.body.code).to.be(undefined);
done();
Expand All @@ -2621,7 +2637,8 @@ describe('server', function () {
request.options('http://localhost:%d/engine.io/default/'.s(port))
.set('Origin', 'http://engine.io')
.query({ transport: 'polling' })
.end(function (res) {
.end(function (err, res) {
expect(err).to.be(null);
expect(res.status).to.be(200);
expect(res.body).to.be.empty();
expect(res.header['access-control-allow-credentials']).to.be('true');
Expand Down

0 comments on commit 0d4e79e

Please sign in to comment.