Skip to content
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

Parse JSON message #10

Closed

Conversation

StephenGregory
Copy link

Inspired by #4 , I wanted to similarly add parsing of JSON strings automatically.


const ws = new Sockette('ws://localhost:8080', {
onmessage: e => {
mockServer.stop();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clean-up that needs to be done before creating a new MockServer. I'd rather put it somewhere else to ensure that it is always called, but could not think of anywhere else to put it as tape does not have any clean-up methods.

@lukeed
Copy link
Owner

lukeed commented Feb 7, 2018

Hi there~!

I'm sorry, but I don't really want this feature in here. 🙈 IMO, it totally belongs as part of your onmessage hook. This means that it can be defined once, per app, and is specific to your server output.

Dismissing PRs is a terrible terrible feeling 💔 but I gotta stick to what I think belongs.

That said, the testing looks great!!! I'd be stoked if you created a new PR that introduced testing for the existing library.

Thank you so much, hope you understand 😞

@lukeed lukeed closed this Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants