Skip to content

Commit

Permalink
Close websocket client connections after use in test.
Browse files Browse the repository at this point in the history
- connections reattempt immediately and were dirtying the test log output
- maybe should remove the "Client closed connection" message as well at some point
  • Loading branch information
isaacgr committed Aug 24, 2021
1 parent 35a7fc5 commit 8233f50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/issues/#54-request-timeout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe("#54 Request timeout", () => {
});
after((done) => {
wss.close().then(() => {
wsclient.end();
done();
});
});
Expand Down Expand Up @@ -98,6 +99,7 @@ describe("#54 Request timeout", () => {
});
after((done) => {
wss.close().then(() => {
wsweb.end();
done();
});
});
Expand Down
1 change: 1 addition & 0 deletions tests/issues/#58-batchresponse-memory-leak.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe("#58 batchResponse causing memory leak", () => {
unhook();
expect(capturedText).to.equal("");
expect(Object.keys(client.listeners).length).to.be.equal(0);
client.end();
});
});
describe("http", () => {
Expand Down
3 changes: 3 additions & 0 deletions tests/server/ws-server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe("WebSocket Server", () => {
});
after((done) => {
wss.close().then(() => {
clientws.end();
done();
});
});
Expand Down Expand Up @@ -69,6 +70,8 @@ describe("WebSocket Server", () => {
result: "Hello jaysonic",
id: 1
});
client1.end();
client2.end();
done();
});
});
Expand Down

0 comments on commit 8233f50

Please sign in to comment.