Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket.io v4 test-suite #34

Open
wants to merge 14 commits into
base: v4
Choose a base branch
from
Open

Conversation

Totodore
Copy link
Contributor

Here is a PR to add a socket.io protocol v4 test suite.

Closes #30

The only thing I'm not sure is this test :

    it("should disallow connection to an unknown namespace", async () => {
      const socket = new WebSocket(
        `${WS_URL}/socket.io/?EIO=3&transport=websocket`
      );

      await waitFor(socket, "message"); // Engine.IO handshake
      await waitFor(socket, "message"); // Socket.IO / namespace handshake
      await waitFor(socket, "message"); // auth packet

      socket.send("40/random");

      const { data } = await waitFor(socket, "message");

      // Should I expect "Invalid namespace" or "{ "message": "Invalid namespace" }"
      expect(data).to.eql('44/random,Invalid namespace');
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants