mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add test and code for client closure events
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user