powertools-lambda-typescript
powertools-lambda-typescript copied to clipboard
fix(metrics): captureColdStartMetric and throwOnEmptyMetrics when set to false was interpreted as true
Description of your changes
Metrics' Middy implementation was checking for undefined to evaluate throwOnEmptyMetrics and captureColdStartMetrics.
How to verify this change
- Get only the unit tests from this PR, see them fail
- Get the update on
middy.ts - rerun the unit tests and see them passed
Related issues, RFCs
Issue number: #1088
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
- [x] My changes meet the tenets criteria
- [x] I have performed a self-review of my own code
- [x] I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] I have made corresponding changes to the examples
- [x] My changes generate no new warnings
- [x] The code coverage hasn't decreased
- [x] I have added tests that prove my change is effective and works
- [x] New and existing unit tests pass locally and in Github Actions
- [x] Any dependent changes have been merged and published in downstream module
- [x] The PR title follows the conventional commit semantics
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.