Skip to content

Conversation

kenperkins
Copy link
Contributor

As a result of 979d0ca there is a new check for undefined values on
OutgoingMessage.setHeader. This commit introduces a test for this case.

As a result of 979d0ca there is a new check for undefined values on
OutgoingMessage.setHeader. This commit introduces a test for this case.
@rvagg
Copy link
Member

rvagg commented Feb 26, 2015

lgtm

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just use assert.throws()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just quickly duplicated the section above. I'm open to suggestions here.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO it would make more sense to use assert.throws() with a validation function like:

function(err) {
  return err instanceof Error && err.message === '`value` required in setHeader("foo", value).';
}

Copy link
Member

Choose a reason for hiding this comment

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

Truth be told, I think the try/catch is more readable.

Copy link
Contributor

Choose a reason for hiding this comment

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

as it is the same style as the above section, @cjihrig would you object to me merging this in as-is?

Copy link
Contributor

Choose a reason for hiding this comment

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

@brendanashworth go for it.

@brendanashworth
Copy link
Contributor

looks good to me

brendanashworth pushed a commit that referenced this pull request Mar 5, 2015
As a result of 979d0ca there is a new check for undefined values on
OutgoingMessage.setHeader. This commit introduces a test for this case.

PR-URL: #970
Reviewed-By: Rod Vagg <[email protected]>
Reviewed-By: Brendan Ashworth <[email protected]>
@brendanashworth
Copy link
Contributor

Thanks @kenperkins, merged in b72fa03! (with modified commit message)

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.

5 participants