docs(protocol): add test with cancelled request

Related: 8f1ea3d58f
This commit is contained in:
Damien Arrachequesne
2025-09-03 08:58:27 +02:00
parent 3be6481d9d
commit a66ed68506

View File

@@ -332,6 +332,25 @@ describe("Engine.IO protocol", () => {
expect(pollResponse.status).to.eql(400);
});
it("closes the session upon cancelled polling request", async () => {
const sid = await initLongPollingSession();
const controller = new AbortController();
fetch(`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`, {
signal: controller.signal,
}).catch(() => {});
await sleep(5);
controller.abort();
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`,
);
expect(pollResponse.status).to.eql(400);
});
});
describe("WebSocket", () => {