From b3f0cab1a0dc101a8aa6a23dc779758019b38a23 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 24 Nov 2023 08:39:53 +0100 Subject: [PATCH] ci: add Node.js 20 in the test matrix Reference: https://github.com/nodejs/Release --- .github/workflows/ci.yml | 8 +++++--- test/connection.ts | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ab6f5c3..bfbd9754 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,9 @@ jobs: strategy: matrix: - node-version: [14, 16] + node-version: + - 14 + - 20 steps: - name: Checkout repository @@ -41,10 +43,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Use Node.js 16 + - name: Use Node.js 20 uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - name: Install dependencies run: npm ci diff --git a/test/connection.ts b/test/connection.ts index 1034cb2b..7b36c4f3 100644 --- a/test/connection.ts +++ b/test/connection.ts @@ -771,7 +771,10 @@ describe("connection", () => { }); } - if (global.Blob && null != textBlobBuilder("xxx")) { + // Blob is available in Node.js since v18, but not yet supported by the `engine.io-parser` package + const isBrowser = typeof window !== "undefined"; + + if (isBrowser && global.Blob && textBlobBuilder("xxx") !== null) { it("should send binary data (as a Blob)", () => { return wrap((done) => { const socket = io(BASE_URL, { forceNew: true });