Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for Node 18, 20 drop support for Node 12 #137

Merged
merged 2 commits into from Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
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
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
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
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