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

fix to solve issue with node v.0.12 #42

Closed
wants to merge 11 commits into from
Closed

fix to solve issue with node v.0.12 #42

wants to merge 11 commits into from

Conversation

adrai
Copy link
Contributor

@adrai adrai commented Feb 7, 2015

solves: #41

@aslakhellesoy
Copy link
Contributor

Can you add a test that proves this code is needed? -A test that would fail if the patch is not applied?

@adrai
Copy link
Contributor Author

adrai commented Feb 7, 2015

the problem is that the existing tests do not pass with 0.12...

@aslakhellesoy
Copy link
Contributor

Oh I see. Maybe update the travis config would surface that?

@aslakhellesoy
Copy link
Contributor

@adrai I've updated the travis config to use 0.12.0. Could you rebase your PR with master so we can see if all the tests will pass on 0.12.0?

Thanks

@adrai
Copy link
Contributor Author

adrai commented Feb 7, 2015

May you fix the existing tests?

@aslakhellesoy
Copy link
Contributor

Yep I'll do that and let you know when it's done. Thanks!

@aslakhellesoy
Copy link
Contributor

I've updated the tests so they run on Node.js 0.12.0 and Io.js 1.1.0.

Now you should be able to add a failing test demonstrating why your proposed patch is needed.

@adrai
Copy link
Contributor Author

adrai commented Feb 9, 2015

if a header value is undefined it would crash on 0.12

@aslakhellesoy
Copy link
Contributor

I'm sure it does, but I still need a failing test to prove it. This will also prevent regressions in the future if someone refactors your code and breaks it.

The commits in this PR are a bit messy. It would be better if you could rebase instead of merging. Please fix that or send a new PR.

@adrai
Copy link
Contributor Author

adrai commented Feb 9, 2015

A new pull req is not a problem... but how should I do a failing test without mocking https://github.com/joyent/node/blob/master/lib/_http_outgoing.js#L333 ?
Isn't this enough https://github.com/adrai/eventsource-node/blob/patch-1/test/eventsource_test.js#L368 ?
Or do you want a dedicated test, that does exactly the same?

@aslakhellesoy
Copy link
Contributor

I missed that you had added a X-something header. (the diff is hard to read now).

Yes, please ass that in a separate test, to make it explicit that we're testing this behaviour.

Thanks!

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