-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Client and Subscription types should be an interface to allow for mocking #86
Comments
Hello! I see the point and agree that currently Probably now it's much simpler to test with real Centrifuge server, running https://github.com/centrifugal/centrifuge Node with some handler. But mocking is harder - I do not have clear answer now, looks like the best you can do is use dependency injection techniques in your code where you are depending on |
Thanks @FZambia ! For now I built my own internal interface wrappers around As the centrifuge-go package stabilizes towards a v1, this would still be nice to have. |
Client
andSubscription
(and probably others I missed) being exposed from the centrifuge-go library as astruct
makes it extremely difficult to mock them in unit tests. It would be nice ifClient
andSubscription
were aninterface
instead ofstruct
.The text was updated successfully, but these errors were encountered: