Skip to content

Commit

Permalink
test: add Node.js 10, 12 and 13 in the test matrix
Browse files Browse the repository at this point in the history
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: #583
  • Loading branch information
darrachequesne committed Feb 6, 2020
1 parent a374471 commit 61e639b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ sudo: false
language: node_js
node_js:
- "8"
- "9"
- "10"
- "12"
- "13"
git:
depth: 1
notifications:
Expand Down
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -56,5 +56,8 @@
},
"files": [
"lib/"
]
],
"engines" : {
"node" : ">=8.0.0"
}
}
15 changes: 6 additions & 9 deletions test/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit 61e639b

Please sign in to comment.