http-errors icon indicating copy to clipboard operation
http-errors copied to clipboard

Add test for extending native errors w/o altering prototype

Open jonchurch opened this issue 1 year ago • 1 comments

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 avatar Mar 09 '24 04:03 jonchurch

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

carpasse avatar May 08 '24 04:05 carpasse