Skip to content

Commit

Permalink
feat: Add support for Node 18, 20 drop support for Node 12 (#137)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This release removes support for Node 12; the minimum required version is Node 14.
  • Loading branch information
dplewis authored Oct 19, 2023
1 parent fdf6d23 commit f203bc1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 3 additions & 7 deletions test/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
};
Expand Down
10 changes: 3 additions & 7 deletions test/multiclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
};
Expand Down
1 change: 0 additions & 1 deletion test/notification/apsProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f203bc1

Please sign in to comment.