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 });