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

Add test for extending native errors w/o altering prototype #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonchurch
Copy link
Member

This adds a test to assert on behavior outlined in the docs but not captured in the test suite.

https://github.com/jshttp/http-errors?tab=readme-ov-file#createerrorstatus-error-properties

createError([status], [error], [properties])

Extend the given error object with createError.HttpError
properties. This will not alter the inheritance of the given
error object, and the modified error object is the
return value.

@jonchurch jonchurch added the tests label Mar 9, 2024
@carpasse
Copy link
Contributor

carpasse commented May 8, 2024

This change looks good to me.
@jonchurch CI should stop failing if you rebase your branch against master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants