You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I need to use a custom environment as I need a newer version of jsdom, so I imported the new @jest/environment-jsdom-abstract package and created a custom environment that extends from that class:
Unfortunately, I did not get that working. I always get this error:
/Users/lughino/ui/node_modules/dd-trace/packages/datadog-plugin-jest/src/index.js:228
this.testSuiteSpan.setTag(TEST_STATUS, status)
^
TypeError: Cannot read properties of undefined (reading 'setTag')
at /Users/lughino/ui/node_modules/dd-trace/packages/datadog-plugin-jest/src/index.js:228:26
at Subscription._handler (/Users/lughino/ui/node_modules/dd-trace/packages/dd-trace/src/plugins/plugin.js:14:9)
at Channel.publish (node:diagnostics_channel:56:9)
at /Users/lughino/ui/node_modules/dd-trace/packages/datadog-instrumentations/src/jest.js:591:27
at runTestInternal (/Users/lughino/ui/node_modules/jest-runner/build/runTest.js:367:16)
at runTest (/Users/lughino/ui/node_modules/jest-runner/build/runTest.js:444:34)
To initiate the dd-trace I tried to use the dd-trace/ci/init through NODE_OPTIONS, or simply including it in this test env file like require('dd-trace').init();.
None of my attempts made it work.
If I switch to testEnvironment: 'jsdom' everything works properly.
I also tried to copy the exact content of the old jest-environment-jsdom package inside this custom file but I always get the same error.
It seems like there is some sort of logic around those test environments that prevents me from using tracing in a custom environment.
Any help would be very appreciated
The text was updated successfully, but these errors were encountered:
This said, I think adding support for @jest/environment-jsdom-abstract wouldn't be too hard (famous last words). Would you be interesting in contributing the change? I can help 😄
Hi there,
I need to use a custom environment as I need a newer version of jsdom, so I imported the new
@jest/environment-jsdom-abstract
package and created a custom environment that extends from that class:Unfortunately, I did not get that working. I always get this error:
To initiate the
dd-trace
I tried to use thedd-trace/ci/init
through NODE_OPTIONS, or simply including it in this test env file likerequire('dd-trace').init();
.None of my attempts made it work.
The jest settings are:
If I switch to
testEnvironment: 'jsdom'
everything works properly.I also tried to copy the exact content of the old
jest-environment-jsdom
package inside this custom file but I always get the same error.It seems like there is some sort of logic around those test environments that prevents me from using tracing in a custom environment.
Any help would be very appreciated
The text was updated successfully, but these errors were encountered: