Closed DanielScharfsteinGit closed 6 months ago
I discovered that we needed to mock the library, as outlined in this link: https://github.com/DataDog/datadog-lambda-js/issues/431#issuecomment-1802554371.
Implementing jest.mock in the global setup resolved the issue.
Expected Behavior
Tests should pass locally and on CI when DD_LOCAL_TEST or DD_LOCAL_TESTING is set to true.
Actual Behavior
Encounter an error in every test when wrapping the handlers with datadog().
Steps to Reproduce the Problem
export const handler = datadog( middy(cancelPaymentHandler) );
Specifications
Stacktrace
Error: