Skip to content

Commit

Permalink
test: increase timeout
Browse files Browse the repository at this point in the history
The tests were randomly failing in the CI.

It might be interesting to have some kind of acknowledgement for the
socketsJoin() method, something like:

```js
const count = await io.socketsJoin("room123");
```
  • Loading branch information
darrachequesne committed Feb 21, 2024
1 parent 310026e commit 44e10ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/socketsJoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("socketsJoin()", () => {
it("makes all socket instances join the specified room", async () => {
servers[0].socketsJoin("room1");

await sleep(200);
await sleep(300);

expect(serverSockets[0].rooms.has("room1")).to.be(true);
expect(serverSockets[1].rooms.has("room1")).to.be(true);
Expand All @@ -30,7 +30,7 @@ describe("socketsJoin()", () => {

servers[0].in("room1").socketsJoin("room2");

await sleep(200);
await sleep(300);

expect(serverSockets[0].rooms.has("room2")).to.be(true);
expect(serverSockets[1].rooms.has("room2")).to.be(false);
Expand All @@ -40,7 +40,7 @@ describe("socketsJoin()", () => {
it("makes the given socket instance join the specified room", async () => {
servers[0].in(serverSockets[1].id).socketsJoin("room3");

await sleep(200);
await sleep(300);

expect(serverSockets[0].rooms.has("room3")).to.be(false);
expect(serverSockets[1].rooms.has("room3")).to.be(true);
Expand Down
6 changes: 3 additions & 3 deletions test/socketsLeave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("socketsLeave()", () => {

servers[0].socketsLeave("room1");

await sleep(200);
await sleep(300);

expect(serverSockets[0].rooms.has("room1")).to.be(false);
expect(serverSockets[1].rooms.has("room1")).to.be(false);
Expand All @@ -34,7 +34,7 @@ describe("socketsLeave()", () => {

servers[0].in("room1").socketsLeave("room2");

await sleep(200);
await sleep(300);

expect(serverSockets[0].rooms.has("room2")).to.be(false);
expect(serverSockets[1].rooms.has("room2")).to.be(false);
Expand All @@ -48,7 +48,7 @@ describe("socketsLeave()", () => {

servers[0].in(serverSockets[1].id).socketsLeave("room3");

await sleep(200);
await sleep(300);

expect(serverSockets[0].rooms.has("room3")).to.be(true);
expect(serverSockets[1].rooms.has("room3")).to.be(false);
Expand Down

0 comments on commit 44e10ae

Please sign in to comment.