Skip to content

Commit

Permalink
test: adapter.close() is now called by io.close()
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Mar 15, 2024
1 parent 5e82a3b commit cdb5535
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 46 deletions.
87 changes: 53 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ export function testSuite(createAdapter: any) {
});

it("broadcasts to all clients in a namespace", (done) => {
const partialDone = times(3, () => {
servers.forEach((server) => server.of("/custom").adapter.close());
done();
});
const partialDone = times(3, done);

servers.forEach((server) => server.of("/custom"));

Expand Down
10 changes: 2 additions & 8 deletions test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,8 @@ export function setup(createAdapter: any) {
serverSockets,
clientSockets,
cleanup: () => {
servers.forEach((server) => {
// @ts-ignore
server.httpServer.close();
server.of("/").adapter.close();
});
clientSockets.forEach((socket) => {
socket.disconnect();
});
servers.forEach((server) => server.close());
clientSockets.forEach((socket) => socket.disconnect());
redisCleanupFunctions.forEach((fn) => fn());
},
});
Expand Down

0 comments on commit cdb5535

Please sign in to comment.