From 61e639b257c91f88200276122816b0514fb396df Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Tue, 14 Jan 2020 23:17:55 +0100 Subject: [PATCH] test: add Node.js 10, 12 and 13 in the test matrix uws is no longer maintained, and did not support Node.js >= 10. We now use a fork in order to support the newer versions of Node.js. It is maintained there: https://github.com/mmdevries/uws And can be installed with: `npm i github:mmdevries/uws#2.4.1` We could also try to support uWebSockets.js, but it does not have the same API as ws. The "engines" attribute has also been added in the package.json file, since we broke the support for Node.js 6 in the latest minor release. Source: https://github.com/mmdevries/uws Related: https://github.com/socketio/engine.io/pull/583 --- .travis.yml | 4 +++- package-lock.json | 5 ++--- package.json | 7 +++++-- test/server.js | 15 ++++++--------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index fbda89be8..a93a3f47e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,9 @@ sudo: false language: node_js node_js: - "8" - - "9" + - "10" + - "12" + - "13" git: depth: 1 notifications: diff --git a/package-lock.json b/package-lock.json index 19b8c3b3d..1706ad680 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1631,9 +1631,8 @@ "dev": true }, "uws": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/uws/-/uws-9.14.0.tgz", - "integrity": "sha512-HNMztPP5A1sKuVFmdZ6BPVpBQd5bUjNC8EFMFiICK+oho/OQsAJy5hnIx4btMHiOk8j04f/DbIlqnEZ9d72dqg==", + "version": "github:mmdevries/uws#0ca2e41cb9337c5bf6bd11e61f9a1fdf3156d56f", + "from": "github:mmdevries/uws#2.4.1", "dev": true }, "which": { diff --git a/package.json b/package.json index 9e2fc5d49..3aef222b6 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "prettier": "^1.19.1", "s": "0.1.1", "superagent": "^3.8.1", - "uws": "~9.14.0" + "uws": "github:mmdevries/uws#2.4.1" }, "scripts": { "lint": "eslint lib/ test/ *.js", @@ -56,5 +56,8 @@ }, "files": [ "lib/" - ] + ], + "engines" : { + "node" : ">=8.0.0" + } } diff --git a/test/server.js b/test/server.js index d36e50dd4..56ac84d9b 100644 --- a/test/server.js +++ b/test/server.js @@ -17,11 +17,6 @@ var expect = require("expect.js"); var request = require("superagent"); var cookieMod = require("cookie"); -// are we running on node < 4.4.3 ? -var NODE_LT_443 = (function() { - var parts = process.versions.node.split("."); - return parts[0] < 4 || parts[1] < 4 || parts[2] < 3; -})(); // are we running uws wsEngine ? var UWS_ENGINE = process.env.EIO_WS_ENGINE === "uws"; @@ -1769,7 +1764,6 @@ describe("server", function() { }); it("should send and receive data with key and cert (polling)", function(done) { - if (UWS_ENGINE && NODE_LT_443) return done(); var srvOpts = { key: fs.readFileSync("test/fixtures/server.key"), cert: fs.readFileSync("test/fixtures/server.crt"), @@ -1810,7 +1804,6 @@ describe("server", function() { }); it("should send and receive data with ca when not requiring auth (polling)", function(done) { - if (UWS_ENGINE && NODE_LT_443) return done(); var srvOpts = { key: fs.readFileSync("test/fixtures/server.key"), cert: fs.readFileSync("test/fixtures/server.crt"), @@ -1849,6 +1842,9 @@ describe("server", function() { }); it("should send and receive data with key and cert (ws)", function(done) { + if (UWS_ENGINE) { + return this.skip(); + } var srvOpts = { key: fs.readFileSync("test/fixtures/server.key"), cert: fs.readFileSync("test/fixtures/server.crt"), @@ -1889,7 +1885,6 @@ describe("server", function() { }); it("should send and receive data with pfx (polling)", function(done) { - if (UWS_ENGINE && NODE_LT_443) return done(); var srvOpts = { key: fs.readFileSync("test/fixtures/server.key"), cert: fs.readFileSync("test/fixtures/server.crt"), @@ -1929,7 +1924,9 @@ describe("server", function() { }); it("should send and receive data with pfx (ws)", function(done) { - if (UWS_ENGINE && NODE_LT_443) return done(); + if (UWS_ENGINE) { + return this.skip(); + } var srvOpts = { key: fs.readFileSync("test/fixtures/server.key"), cert: fs.readFileSync("test/fixtures/server.crt"),