Real-time websites and notifications have become more and more prominent over the past few years. And unless you’re looking to spend a decent amount of time supporting different browsers you’ll be using a service like Pusher. It has been around since 2010 and is used by websites like Travis CI and UserVoice.
I’ve tried to make the fake simple to use while attempting to avoid modifying your production code as little as possible.
First you’ll need to require the dependency in the test environment.
And finally if you’re using Cucumber you can easily start up the properly configured servers by including a helper file.
If you’re not using Cucumber, see the helper file on how to do it manually.
Your application should just work as is for testing now, even when offline. Which includes triggering events from the server, triggering and responding to webhooks, and triggering and responding to events on the client.