Open BioPaulK opened 6 days ago
hey @BioPaulK ! Thanks for the report. I'll have a look and get back to you as soon as possible 😄
thanks for the investigation @BioPaulK. This is indeed a bug in dd-trace-js. I'll push a fix as soon as possible. To confirm that what I do actually fixes your issue, could you provide a small reproducible case?
Here you go - npm test
should cause the error. https://github.com/BioPaulK/test-ddtrace-bug
In our app, we utilize the library office-addin-mock during our test process, to mock our interactions with office addin code.
If we follow its dependency tree through
office-addin-mock
->office-addin-usage-data
->applicationinsights
->diagnostic-channel-publishers
, one can find that indiagnostic-channel-publishers
, we import our own, local version of winston called winston.pub.Because of this contains logic, this causes the import of
./winston.pub
(and any other similarly-named local modules) to utilizeshimmer._requireCoreModule
instead ofrequireModuleOrMock
from jest. The shimmer method does not work with this local import, so you end up with an error message like the following when attempting to importoffice-addin-mock
:My educated guess is that this logic in
packages/datadog-instrumentations/src/jest.js
wasn't really meant to be a contains but an equals:I originally thought this was resolved in 5.26 but that turned out to be operator error.