GithubHelp home page GithubHelp logo

matthieua / pusher-fake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tristandunn/pusher-fake

1.0 3.0 1.0 307 KB

A fake Pusher server for development and testing.

License: MIT License

Ruby 100.00%

pusher-fake's Introduction

pusher-fake Build Status Dependency Status Code Climate Coverage Status

A fake Pusher server for development and testing.

Usage

1. Use the PusherFake JS for the Pusher JS instance.

<script>
  <% if defined?(PusherFake) %>
    // Test environment.
    //
    // Note: Ensure output is not HTML escaped, such as with the raw helper in Rails.
    var instance = <%= PusherFake.javascript %>;
  <% else %>
    // Other environments, such as production.
    var instance = new Pusher(...);
  <% end %>
</script>

2. Start PusherFake in Cucumber environment. If you aren't using Cucumber, see pusher-fake/cucumber.rb.

require "pusher-fake/cucumber"

Examples

  • pusher-fake-example - An example of using pusher-fake with Cucumber to test a Rails application.

Goal

Fully recreate the Pusher API service for development and testing.

Why?

  • Using a remote API for testing is slow.
  • Working offline is currently impossible.
  • Wasting connections and messages in development is unreasonable.
  • Stubbing the JavaScript, such as with pusher-test-stub, is suboptimal and tedious for integration tests.

License

pusher-fake uses the MIT license. See LICENSE for more details.

pusher-fake's People

Contributors

markoa avatar tristandunn avatar twalpole avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

beingsane

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.