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

feat: common websocket client #552

Merged
merged 15 commits into from May 5, 2022
Merged

Conversation

PhilippHeuer
Copy link
Member

@PhilippHeuer PhilippHeuer commented Mar 12, 2022

Prerequisites for Code Changes

  • This pull request follows the code style of the project
  • I have tested this feature

Changes Proposed

This improves our testing capabilities in modules that use websocket connections.

  • move common code into a websocket-client module
  • chat now uses the websocket-client module
  • pubSub now uses the websocket-client module
  • adds getLatency to pubsub / pubsubpool
  • adds a TestEventManager that tracks a list of all published events in order for testing
  • uses the spec instead of the builder approach for the WebsocketConnection

and now we can:

  • mock the websocket connection and validate that messages would be send as expected
  • simulate messages from the websocket server

Additional Information

This also includes a few example tests for chat / pubSub to show how the usage would look like.

Copy link
Member

@iProdigy iProdigy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this off the ground!

@PhilippHeuer PhilippHeuer marked this pull request as ready for review May 4, 2022 17:54
Co-authored-by: Sidd <iProdigy@users.noreply.github.com>
Copy link
Member

@iProdigy iProdigy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this!

@PhilippHeuer PhilippHeuer merged commit 8e0c28f into develop May 5, 2022
@PhilippHeuer PhilippHeuer deleted the feature/websocket-common branch May 5, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants