-
Notifications
You must be signed in to change notification settings - Fork 297
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
export wstest #340
Comments
I figured you'd always want to use |
I found this internal package useful for testing. I have a struct that stays around for the duration of a websocket connection, and it has a Some advice on how I could use standard |
@leosunmo thanks for sharing your experience. A fairly simple example of using
I'll think about how we can help guide users in writing tests better and we will also consider exporting the |
Thanks for the quick reply and example code! That approach works really well when I am testing the client part, but less well when I am testing the server part. For example, I want to test how well my server handles a client not responding to the Close handshake. I do something like this:
which leads to This is presumable the same issue as #455. I want to pass that |
Pipe function here: https://github.com/nhooyr/websocket/blob/master/internal/test/wstest/pipe.go#L17 is inside the internal package which means it can't be imported by other projects.
However it should be external so that it can be imported by other projects. This could help in unit testing of the projects
The text was updated successfully, but these errors were encountered: