Skip to content

Fix Logger is not handling missing context #267

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

Closed

Conversation

rwhite-lightbox
Copy link

@rwhite-lightbox rwhite-lightbox commented May 14, 2024

Logger is not handling missing context...
#260

@rwhite-lightbox rwhite-lightbox changed the title Fix logger.js Fix Logger is not handling missing context May 14, 2024
@naorpeled
Copy link
Collaborator

Hey @RWhite-EDR ,
first of all, thanks for this!

Can you please add a unit test to verify this?

@rwhite-lightbox
Copy link
Author

@naorpeled I'm not sure if I can as the context object is almost always present. It is only missing in my unit test of my routes. I've never seen this issue from within API Gateway, ALB, or serverless-offline. Only in my jest-based unit tests.

@naorpeled naorpeled added this to the v1.1.0 milestone Jun 1, 2024
@naorpeled
Copy link
Collaborator

naorpeled commented Jun 9, 2024

Hey @RWhite-EDR
will make a minor change tomorrow and then release this 🙏

You rock!

Sorry for the delay

@naorpeled
Copy link
Collaborator

Hey @RWhite-EDR,
I gave this some more thought and I think that because this isn't a real use case we shouldn't really support it.
Sorry for the confusion and thanks for your time.

@naorpeled naorpeled closed this Jun 10, 2024
@rwhite-lightbox
Copy link
Author

@naorpeled Rats -- so close. I'm not sure why testing of the main function using Jest isn't a real use case. Maybe I need a better mock, but I can show you where this is failing from my test scripts.

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.

2 participants