davidbanham / express-async-errors

async/await support for ExpressJS
Other
900 stars 43 forks source link

Test + code to copy properties from the old function to wrapped function #11

Closed eXigentCoder closed 6 years ago

eXigentCoder commented 6 years ago

Hey there

Someone who uses my library recently ran into an issue with the two libraries working together. The reason for the issue is that when wrapping the existing function, the old properties on the function were not being copied across to the new function.

In this PR is a test that was failing before the code change and passing now as well as the code to copy the properties across.

Thanks a lot!

jdnichollsc commented 6 years ago

@eXigentCoder Woww thanks for the contribution to use express in the best way!

jdnichollsc commented 6 years ago

@davidbanham what do you think? 👍

davidbanham commented 6 years ago

Looks great to me! Sorry it took a couple days to review, was busy with family over the weekend.

@eXigentCoder Many thanks for the excellent PR! Will merge now.

I'm going to bump the major for this release on NPM since it's a change to the external API. I don't think it'd be likely to break anyone's code, but better safe than sorry.

davidbanham commented 6 years ago

Live on NPM as 3.0.0 now.

https://www.npmjs.com/package/express-async-errors

gr2m commented 6 years ago

Could you add some changelogs somewhere? First place I usually look for is a GitHub release with the same version number: https://github.com/davidbanham/express-async-errors/releases but there is none yet, 2nd place a CHANGELOG.md file. Probot is using express-async-errors :) https://github.com/probot/probot/pull/559

eXigentCoder commented 6 years ago

An absolute pleasure, glad I was able to contribute!

davidbanham commented 6 years ago

@gr2m Thanks for spotting that. I had tagged it, but the remote didn't get updated due to an authentication snafu. I've pushed it now.

Have also added some release notes.

https://github.com/davidbanham/express-async-errors/releases