add test and code for client closure events

This commit is contained in:
2025-04-30 18:17:27 -07:00
parent 31e9c78ebd
commit f74376c8ed
2 changed files with 22 additions and 7 deletions

View File

@@ -168,7 +168,7 @@ describe("AppleNotificationSender", () => {
});
it("registers a handler to close the connection if `close` event fired", async () => {
const connectionCloseEvents = ['close', 'goaway', 'error'];
const connectionCloseEvents = ['close', 'goaway', 'error', 'timeout'];
await Promise.all(connectionCloseEvents.map(async (event) => {
const mockClient = new MockClient(200);
@@ -179,7 +179,7 @@ describe("AppleNotificationSender", () => {
body: ''
};
const result = await notificationSender.sendNotificationImmediately('1', notificationArguments);
await notificationSender.sendNotificationImmediately('1', notificationArguments);
mockClient.emit(event);