From f88ac154a2b6a24160710a9cc402699a8bf5113d Mon Sep 17 00:00:00 2001 From: John Doe Date: Sun, 6 Nov 2022 12:28:59 +0000 Subject: [PATCH] Mark node v19 as supported (#14837) * Mark node19 as supported * Fix condition * Fix tests Co-authored-by: Ainur Timerbaev --- .github/workflows/ci.yml | 2 +- package.json | 2 +- test/externalExtension.test.js | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20cfa356a..761ebaa08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node: [14, 16, 18] + node: [14, 16, 18, 19] runs-on: ${{ matrix.os }} continue-on-error: true steps: diff --git a/package.json b/package.json index 88a7c6f71..8857f37ec 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "git+https://github.com/Koenkk/zigbee2mqtt.git" }, "engines": { - "node": "^14 || ^16 || ^18" + "node": "^14 || ^16 || ^18 || ^19" }, "keywords": [ "xiaomi", diff --git a/test/externalExtension.test.js b/test/externalExtension.test.js index ce5c2315a..4a86046f6 100644 --- a/test/externalExtension.test.js +++ b/test/externalExtension.test.js @@ -84,7 +84,12 @@ describe('User extensions', () => { MQTT.events.message('zigbee2mqtt/bridge/request/extension/save', stringify({"name": "foo.js", "code": extensionCode})); await flushPromises(); - expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/bridge/response/extension/save', stringify({"data":{},"error":"Unexpected identifier","status":"error"}), { retain: false, qos: 0 }, expect.any(Function)); + expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/bridge/response/extension/save', expect.any(String), { retain: false, qos: 0 }, expect.any(Function)); + const payload = JSON.parse(MQTT.publish.mock.calls[0][1]); + expect(payload).toEqual( + expect.objectContaining({"data":{},"status":"error"}) + ); + expect(payload.error).toMatch("Unexpected identifier"); }); it('Removes user extension', async () => {