docs: add test should close the connection if no handshake is received (#31)

This commit is contained in:
Théodore Prévot
2023-09-19 17:15:55 +02:00
committed by GitHub
parent 5924e987b6
commit 4f633dd6a4
2 changed files with 10 additions and 0 deletions

View File

@@ -704,6 +704,7 @@ const io = new Server(3000, {
pingInterval: 300,
pingTimeout: 200,
maxPayload: 1000000,
connectTimeout: 1000,
cors: {
origin: "*"
}

View File

@@ -507,6 +507,15 @@ describe("Socket.IO protocol", () => {
await waitFor(socket, "close");
});
it("should close the connection if no handshake is received", async () => {
const socket = new WebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "close");
});
});
describe("disconnect", () => {