Skip to content

Commit f203bc1

Browse files
authored
feat: Add support for Node 18, 20 drop support for Node 12 (#137)
BREAKING CHANGE: This release removes support for Node 12; the minimum required version is Node 14.
1 parent fdf6d23 commit f203bc1

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ jobs:
1111
strategy:
1212
matrix:
1313
include:
14-
- name: Node.js 12
15-
NODE_VERSION: 12
1614
- name: Node.js 14
1715
NODE_VERSION: 14
1816
- name: Node.js 16
1917
NODE_VERSION: 16
18+
- name: Node.js 18
19+
NODE_VERSION: 18
20+
- name: Node.js 20
21+
NODE_VERSION: 20
22+
fail-fast: false
23+
name: ${{ matrix.name }}
2024
runs-on: ubuntu-latest
2125
timeout-minutes: 30
2226
steps:

test/client.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,7 @@ describe('Client', () => {
352352
const result = await client.write(mockNotification, mockDevice);
353353
// Should not happen, but if it does, the promise should resolve with an error
354354
expect(result.device).to.equal(MOCK_DEVICE_TOKEN);
355-
expect(result.error.message).to.equal(
356-
'Unexpected error processing APNs response: Unexpected token P in JSON at position 0'
357-
);
355+
expect(result.error.message.startsWith('Unexpected error processing APNs response: Unexpected token')).to.equal(true);
358356
};
359357
await runRequestWithInternalServerError();
360358
await runRequestWithInternalServerError();
@@ -427,10 +425,8 @@ describe('Client', () => {
427425
const mockDevice = MOCK_DEVICE_TOKEN;
428426
const performRequestExpectingGoAway = async () => {
429427
const result = await client.write(mockNotification, mockDevice);
430-
expect(result).to.deep.equal({
431-
device: MOCK_DEVICE_TOKEN,
432-
error: new VError('stream ended unexpectedly with status null and empty body'),
433-
});
428+
expect(result.device).to.equal(MOCK_DEVICE_TOKEN);
429+
expect(result.error).to.be.an.instanceof(VError);
434430
expect(didGetRequest).to.be.true;
435431
didGetRequest = false;
436432
};

test/multiclient.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,7 @@ describe('MultiClient', () => {
373373
const result = await client.write(mockNotification, mockDevice);
374374
// Should not happen, but if it does, the promise should resolve with an error
375375
expect(result.device).to.equal(MOCK_DEVICE_TOKEN);
376-
expect(result.error.message).to.equal(
377-
'Unexpected error processing APNs response: Unexpected token P in JSON at position 0'
378-
);
376+
expect(result.error.message.startsWith('Unexpected error processing APNs response: Unexpected token')).to.equal(true);
379377
};
380378
await runRequestWithInternalServerError();
381379
await runRequestWithInternalServerError();
@@ -448,10 +446,8 @@ describe('MultiClient', () => {
448446
const mockDevice = MOCK_DEVICE_TOKEN;
449447
const performRequestExpectingGoAway = async () => {
450448
const result = await client.write(mockNotification, mockDevice);
451-
expect(result).to.deep.equal({
452-
device: MOCK_DEVICE_TOKEN,
453-
error: new VError('stream ended unexpectedly with status null and empty body'),
454-
});
449+
expect(result.device).to.equal(MOCK_DEVICE_TOKEN);
450+
expect(result.error).to.be.an.instanceof(VError);
455451
expect(didGetRequest).to.be.true;
456452
didGetRequest = false;
457453
};

test/notification/apsProperties.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,6 @@ describe('Notification', function () {
960960
describe('setContentState', function () {
961961
it('is chainable', function () {
962962
expect(note.setContentState(payload)).to.equal(note);
963-
console.log(compiledOutput());
964963
expect(compiledOutput())
965964
.to.have.nested.property('aps.content-state')
966965
.that.deep.equals(payload);

0 commit comments

Comments
 (0)