diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 491d14a9..93641614 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,16 @@ jobs: strategy: matrix: include: - - name: Node.js 12 - NODE_VERSION: 12 - name: Node.js 14 NODE_VERSION: 14 - name: Node.js 16 NODE_VERSION: 16 + - name: Node.js 18 + NODE_VERSION: 18 + - name: Node.js 20 + NODE_VERSION: 20 + fail-fast: false + name: ${{ matrix.name }} runs-on: ubuntu-latest timeout-minutes: 30 steps: diff --git a/test/client.js b/test/client.js index d829dddd..c3a32c08 100644 --- a/test/client.js +++ b/test/client.js @@ -352,9 +352,7 @@ describe('Client', () => { const result = await client.write(mockNotification, mockDevice); // Should not happen, but if it does, the promise should resolve with an error expect(result.device).to.equal(MOCK_DEVICE_TOKEN); - expect(result.error.message).to.equal( - 'Unexpected error processing APNs response: Unexpected token P in JSON at position 0' - ); + expect(result.error.message.startsWith('Unexpected error processing APNs response: Unexpected token')).to.equal(true); }; await runRequestWithInternalServerError(); await runRequestWithInternalServerError(); @@ -427,10 +425,8 @@ describe('Client', () => { const mockDevice = MOCK_DEVICE_TOKEN; const performRequestExpectingGoAway = async () => { const result = await client.write(mockNotification, mockDevice); - expect(result).to.deep.equal({ - device: MOCK_DEVICE_TOKEN, - error: new VError('stream ended unexpectedly with status null and empty body'), - }); + expect(result.device).to.equal(MOCK_DEVICE_TOKEN); + expect(result.error).to.be.an.instanceof(VError); expect(didGetRequest).to.be.true; didGetRequest = false; }; diff --git a/test/multiclient.js b/test/multiclient.js index 2af731fb..243c19ea 100644 --- a/test/multiclient.js +++ b/test/multiclient.js @@ -373,9 +373,7 @@ describe('MultiClient', () => { const result = await client.write(mockNotification, mockDevice); // Should not happen, but if it does, the promise should resolve with an error expect(result.device).to.equal(MOCK_DEVICE_TOKEN); - expect(result.error.message).to.equal( - 'Unexpected error processing APNs response: Unexpected token P in JSON at position 0' - ); + expect(result.error.message.startsWith('Unexpected error processing APNs response: Unexpected token')).to.equal(true); }; await runRequestWithInternalServerError(); await runRequestWithInternalServerError(); @@ -448,10 +446,8 @@ describe('MultiClient', () => { const mockDevice = MOCK_DEVICE_TOKEN; const performRequestExpectingGoAway = async () => { const result = await client.write(mockNotification, mockDevice); - expect(result).to.deep.equal({ - device: MOCK_DEVICE_TOKEN, - error: new VError('stream ended unexpectedly with status null and empty body'), - }); + expect(result.device).to.equal(MOCK_DEVICE_TOKEN); + expect(result.error).to.be.an.instanceof(VError); expect(didGetRequest).to.be.true; didGetRequest = false; }; diff --git a/test/notification/apsProperties.js b/test/notification/apsProperties.js index db95a42c..9ec9b6eb 100644 --- a/test/notification/apsProperties.js +++ b/test/notification/apsProperties.js @@ -960,7 +960,6 @@ describe('Notification', function () { describe('setContentState', function () { it('is chainable', function () { expect(note.setContentState(payload)).to.equal(note); - console.log(compiledOutput()); expect(compiledOutput()) .to.have.nested.property('aps.content-state') .that.deep.equals(payload);