socketio / socket.io-website

Socket.IO website and blog
https://socket.io
318 stars 668 forks source link

[docs] Improve Socket.io Testing documentation with integration test #407

Closed JoaoGuiMB closed 11 months ago

JoaoGuiMB commented 11 months ago

I’ve been strugling to implement integration tests with Socket.io for some time. I didn’t find any good tutorial, and the documentation lacks in this part. Here are some problems I had:

  1. It does not show how to listen to events on the server, like serverSocket.on(”received-message”, (data) ⇒ doSomething(data)) and get a response on the client to assert
  2. Examples without TypeScript
  3. No example with vitest

I already implemented a simple demo around that, is it valid to create a pull request?

JoaoGuiMB commented 11 months ago

Pull request accepted