powertools-lambda-typescript icon indicating copy to clipboard operation
powertools-lambda-typescript copied to clipboard

fix(metrics): captureColdStartMetric and throwOnEmptyMetrics when set to false was interpreted as true

Open flochaz opened this issue 1 year ago • 1 comments

Description of your changes

Metrics' Middy implementation was checking for undefined to evaluate throwOnEmptyMetrics and captureColdStartMetrics.

How to verify this change

  1. Get only the unit tests from this PR, see them fail
  2. Get the update on middy.ts
  3. 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.

flochaz avatar Sep 16 '22 12:09 flochaz

No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.

github-actions[bot] avatar Sep 16 '22 12:09 github-actions[bot]