Open yarcub opened 8 years ago
@yarcub we haven't but that would be something we probably should do. I'll have a look into it soon.
So I just looked into this but it would take a bit more work to make this work properly in a CommonJS environment.
It works in the browser by replacing window.Pusher
with the stubbed version, but in a CommonJS environment you wouldn't be able to do this. We'd love to look into this further; please let us know if you have any further thoughts.
Hello! I know this issue is old but I'd like to suggest an idea.
Perhaps we can export the PusherTestStub
object itself so that users could manually bind that object to window.Pusher
?
A user-facing example (in my Ember app testing with QUnit) would look like:
//test-helper.js
import PusherTestStub from 'pusher-test-stub';
export default {
beforeEach: function(){
...
window.Pusher = PusherTestStub;
...
}
}
Would this be feasible? Thanks!
Hey y'all 👋
I released an NPM library for mocking Pusher in your tests. If you're interested, check it out at https://github.com/nikolalsvk/pusher-js-mock
Hi, have you considered making this package also available on npm?