-
Notifications
You must be signed in to change notification settings - Fork 146
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
Chore(tracer): unit tests to verify decorators await decorated class methods #1108
Chore(tracer): unit tests to verify decorators await decorated class methods #1108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Small suggestions on readability but will leave it up to you.
Co-authored-by: ijemmy <[email protected]>
Co-authored-by: ijemmy <[email protected]>
Thank you @ijemmy, I have accepted both your suggestions. |
Going to merge this. @ijemmy's previously already approved the PR and left comments which were addressed, so I'm going to consider this as approved. |
Description of your changes
In #1091 it was reported that the
tracer.captureMethod()
andtracer.captureLambdaHandler()
decorators might not be awaiting correctly the decorated methods.After a closer look it seems that they we already awaited properly, see:
captureMethod
here: https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/packages/tracer/src/Tracer.ts#L440captureLambdaHandler
here: https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/packages/tracer/src/Tracer.ts#L367This PR simply introduces unit tests to prove that this is the case and to guard against any future regressions.
How to verify this change
See existing & new unit tests passing.
Related issues, RFCs
Issue number: #1091
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
N/A
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.