-
-
Notifications
You must be signed in to change notification settings - Fork 459
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
Add clearSubscriptions method #62
Conversation
@aron do you think it would be more natural to use the |
PubSub.publishSync(topic, TestHelper.getUniqueString()); | ||
|
||
refute(spy1.called); | ||
refute(spy2.called); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may also want to assert that it only cleared this topic, this test would also pass if all topics were cleared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I think it deserves a separate test, to make it clear what's going on
Now you mention it, yes that feels more natural. Instead of having the wildcard you could have a Otherwise this looks good. I couldn't get the tests to run locally. I ran:
|
Try running the tests with |
@mroderick same issue. Does it work for you from a clean install? Bear in mind I don't have any packages installed globally. |
Getting closer. Removing th https://github.com/mroderick/PubSubJS/blob/master/package.json#L11 |
It does, it also works on Travis, so I think it's another case of your funky node environment :) |
Good to know :) At least I can trust Travis. |
```javascript | ||
PubSub.clearSubscriptions('*'); | ||
// all subscriptions are removed | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs updating now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it does. I've fixed that. Perhaps it'd be best to squash all these commits down, before merging
🚢 |
Thanks |
This pull request implements a
clearSubscriptions
method, that has been requested in #41 and #60