tristandunn / pusher-fake

A fake Pusher server for development and testing.
https://rubygems.org/gems/pusher-fake
MIT License
173 stars 32 forks source link

Mock statsHost #56

Closed fikrikarim closed 5 years ago

fikrikarim commented 5 years ago

Hi @tristandunn, first of all thank you very much for creating and maintaining this gem. This really helps our app to test Pusher correctly! Thanks a lot :)

One thing I noticed is that not all of the client request is mocked already. There's request to statsHost that aren't directed to local server. I mean that shouldn't be a great deal. But right now we're not using VCR yet and we try to avoid making a request to a remote server. I wonder if it's possible to redirect the statsHost to local too or are you intentionally leaving that part?

Thanks!

tristandunn commented 5 years ago

Looks like you can disable the statsHost usage with the disableStats option.

That should be as simple as providing the option to the javascript helper:

<%= PusherFake.javascript(disableStats: true) %>

Let me know if that helps! Also, I'll look into adding the host and disable options to the configuration, and defaulting to the stats being disabled.

fikrikarim commented 5 years ago

Oh I see. Yes that should help with our use case. I didn't know there's disableStats option. Thanks for the fast response Tristan :)

tristandunn commented 5 years ago

Awesome! Realized I forgot to link to the client options page.

fikrikarim commented 5 years ago

Cool man. Now I'm working on the chat feature using the Pusher Chatkit, and I miss this gem already 👍

tristandunn commented 5 years ago

Glad to hear it's helpful!

And maybe I should look into Chatkit support, or a creating a new library. I'd hope that a lot of it is just functionally built on top of the existing Pusher implementation.

tristandunn commented 5 years ago

Added disable_stats setting in https://github.com/tristandunn/pusher-fake/commit/7800b5b059b867e3a2da6f2388a155cc50ad8a86, and will be in the next release.

tristandunn commented 5 years ago

@fikrikarim Released a new version with the disableStats configuration in it.

fikrikarim commented 5 years ago

@tristandunn got it thanks @tristandunn !