Skip to content

Commit fd20b91

Browse files
[test] Use npm scripts instead of gulp (#530)
1 parent 7f63d38 commit fd20b91

File tree

11 files changed

+49
-132
lines changed

11 files changed

+49
-132
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
node_modules
22
npm-debug.log
3-
coverage.html
4-
lib-cov/
5-
dist

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: node_js
33
node_js:
44
- "4"
55
- "6"
6-
- "7"
6+
- "8"
77
git:
88
depth: 1
99
notifications:

Makefile

Lines changed: 0 additions & 16 deletions
This file was deleted.

gulpfile.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

index.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

lib/server.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ Server.errorMessages = {
9191

9292
util.inherits(Server, EventEmitter);
9393

94-
/**
95-
* Hash of open clients.
96-
*
97-
* @api public
98-
*/
99-
100-
Server.prototype.clients;
101-
10294
/**
10395
* Initialize websocket server
10496
*
@@ -355,7 +347,7 @@ Server.prototype.handleUpgrade = function (req, socket, upgradeHead) {
355347
return;
356348
}
357349

358-
var head = new Buffer(upgradeHead.length);
350+
var head = new Buffer(upgradeHead.length); // eslint-disable-line node/no-deprecated-api
359351
upgradeHead.copy(head);
360352
upgradeHead = null;
361353

lib/socket.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ Socket.prototype.onPacket = function (packet) {
9191
this.setPingTimeout();
9292

9393
switch (packet.type) {
94-
9594
case 'ping':
9695
debug('got ping');
9796
this.sendPacket('pong');

lib/transports/polling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Polling.prototype.onDataRequest = function (req, res) {
136136
this.dataReq = req;
137137
this.dataRes = res;
138138

139-
var chunks = isBinary ? new Buffer(0) : '';
139+
var chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api
140140
var self = this;
141141

142142
function cleanup () {
@@ -162,7 +162,7 @@ Polling.prototype.onDataRequest = function (req, res) {
162162
}
163163

164164
if (contentLength > self.maxHttpBufferSize) {
165-
chunks = isBinary ? new Buffer(0) : '';
165+
chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api
166166
req.connection.destroy();
167167
}
168168
}

package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "engine.io",
33
"version": "3.1.0",
44
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",
5-
"main": "./lib/engine.io",
5+
"main": "lib/engine.io",
66
"author": "Guillermo Rauch <[email protected]>",
77
"homepage": "https://github.com/socketio/engine.io",
88
"contributors": [
@@ -33,17 +33,16 @@
3333
"cookie": "0.3.1"
3434
},
3535
"devDependencies": {
36-
"babel-eslint": "5.0.0",
36+
"babel-eslint": "^7.2.3",
3737
"babel-preset-es2015": "^6.24.0",
3838
"engine.io-client": "3.1.0",
39-
"eslint-config-standard": "4.4.0",
40-
"eslint-plugin-standard": "1.3.2",
39+
"eslint": "^4.5.0",
40+
"eslint-config-standard": "^10.2.1",
41+
"eslint-plugin-import": "^2.7.0",
42+
"eslint-plugin-node": "^5.1.1",
43+
"eslint-plugin-promise": "^3.5.0",
44+
"eslint-plugin-standard": "^3.0.1",
4145
"expect.js": "^0.3.1",
42-
"gulp": "^3.9.1",
43-
"gulp-babel": "^6.1.2",
44-
"gulp-eslint": "1.1.1",
45-
"gulp-mocha": "^4.3.0",
46-
"gulp-nsp": "^2.4.1",
4746
"mocha": "^3.2.0",
4847
"s": "0.1.1",
4948
"superagent": "0.15.4"
@@ -52,14 +51,14 @@
5251
"uws": "~0.14.4"
5352
},
5453
"scripts": {
55-
"test": "gulp test; EIO_WS_ENGINE=ws gulp test;"
54+
"lint": "eslint lib/ test/ *.js",
55+
"test": "npm run lint && mocha && EIO_WS_ENGINE=ws mocha"
5656
},
5757
"repository": {
5858
"type": "git",
5959
"url": "[email protected]:socketio/engine.io.git"
6060
},
6161
"files": [
62-
"index.js",
6362
"lib/"
6463
]
6564
}

test/jsonp.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var request = require('superagent');
1111
describe('JSONP', function () {
1212
before(function () {
1313
// we have to override the browser's functionality for JSONP
14-
document = { // eslint-disable-line no-native-reassign, no-undef
14+
document = { // eslint-disable-line no-global-assign
1515
body: {
1616
appendChild: function () {},
1717
removeChild: function () {}
@@ -44,10 +44,10 @@ describe('JSONP', function () {
4444
appendChild: function () {},
4545
submit: function () {
4646
request
47-
.post(this.action)
48-
.type('form')
49-
.send({ d: self.areaValue })
50-
.end(function () {});
47+
.post(this.action)
48+
.type('form')
49+
.send({ d: self.areaValue })
50+
.end(function () {});
5151
}
5252
};
5353
return form;
@@ -156,7 +156,7 @@ describe('JSONP', function () {
156156
});
157157

158158
it('should arrive from server to client and back with binary data (pollingJSONP)', function (done) {
159-
var binaryData = new Buffer(5);
159+
var binaryData = Buffer.allocUnsafe(5);
160160
for (var i = 0; i < 5; i++) binaryData[i] = i;
161161
engine.on('connection', function (conn) {
162162
conn.on('message', function (msg) {
@@ -178,7 +178,7 @@ describe('JSONP', function () {
178178
it('should trigger when server closes a client', function (done) {
179179
var engine = listen({ allowUpgrades: false, transports: ['polling'] }, function (port) {
180180
var socket = new eioc.Socket('ws://localhost:' + port,
181-
{ transports: ['polling'], forceJSONP: true, upgrade: false });
181+
{ transports: ['polling'], forceJSONP: true, upgrade: false });
182182
var total = 2;
183183

184184
engine.on('connection', function (conn) {

0 commit comments

Comments
 (0)