From d4b3ddedffa5aba59657db795a4787052e16c9a0 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Sat, 19 Oct 2024 09:12:29 +0200 Subject: [PATCH] ci: use Node.js 22 Reference: https://github.com/nodejs/Release --- .github/workflows/ci.yml | 1 + packages/engine.io-client/test/index.js | 4 +--- packages/engine.io/test/common.js | 5 +++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce37224d3e..2428514cd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: node-version: - 18 - 20 + - 22 services: redis: diff --git a/packages/engine.io-client/test/index.js b/packages/engine.io-client/test/index.js index 237d199a74..5e481865c5 100644 --- a/packages/engine.io-client/test/index.js +++ b/packages/engine.io-client/test/index.js @@ -7,8 +7,6 @@ if (env.browser) { require("./node"); } -const Blob = require("blob"); - require("./engine.io-client"); require("./socket"); require("./transport"); @@ -23,6 +21,6 @@ if (typeof ArrayBuffer !== "undefined") { } // Blob is available in Node.js since v18, but not yet supported by the `engine.io-parser` package -if (Blob && env.browser) { +if (typeof Blob === "function" && env.browser) { require("./blob"); } diff --git a/packages/engine.io/test/common.js b/packages/engine.io/test/common.js index 136395fbbb..4b5d5a5950 100644 --- a/packages/engine.io/test/common.js +++ b/packages/engine.io/test/common.js @@ -1,3 +1,8 @@ +if (process.env.EIO_CLIENT === "3" && process.versions.node.startsWith("22")) { + // FIXME WebSocket error with engine.io-client@3 + global.WebSocket = null; +} + const { listen, uServer } = require(".."); const { Socket } = process.env.EIO_CLIENT === "3"