lambda-api icon indicating copy to clipboard operation
lambda-api copied to clipboard

Fix Logger is not handling missing context

Open rwhite-lightbox opened this issue 1 year ago • 2 comments

Logger is not handling missing context... https://github.com/jeremydaly/lambda-api/issues/260

rwhite-lightbox avatar May 14 '24 14:05 rwhite-lightbox

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

Can you please add a unit test to verify this?

naorpeled avatar May 14 '24 15:05 naorpeled

@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.

rwhite-lightbox avatar May 20 '24 18:05 rwhite-lightbox

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

You rock!

Sorry for the delay

naorpeled avatar Jun 09 '24 21:06 naorpeled

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 avatar Jun 10 '24 19:06 naorpeled

@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.

rwhite-lightbox avatar Jun 17 '24 20:06 rwhite-lightbox