[test optimization] Fix @jest/transform not to modify testEnvironmentOptions's shape#7718
Conversation
Overall package sizeSelf size: 4.95 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.0 | 81.15 kB | 815.98 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7718 +/- ##
==========================================
+ Coverage 80.35% 80.38% +0.03%
==========================================
Files 741 741
Lines 32004 32064 +60
==========================================
+ Hits 25718 25776 +58
- Misses 6286 6288 +2 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-03-10 09:45:39 Comparing candidate commit e3dcdf1 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 230 metrics, 30 unstable metrics. |
watson
left a comment
There was a problem hiding this comment.
CODEOWNERS review 👍
As a follow up PR I suggest you set the ownership of these folders to @DataDog/ci-app-libraries as well, similar to what you just did in this PR for /integration-tests/jest/:
/integration-tests/mocha//integration-tests/playwright//integration-tests/cucumber//integration-tests/cypress//integration-tests/vitest/
…entOptions`'s shape (#7718)
|
…entOptions`'s shape (#7718)
What does this PR do?
Fixes
@jest/transformhook sodd-traceno longer breaks coverage transforms by cloningtestEnvironmentOptions. The fix preserves the originaltestEnvironmentOptionsobject by temporarily removing and restoring Datadog-specific keys instead of cloning.Additionally, adds a new
@jest/transformhook forjest>=30, which was missing.Motivation
A customer report showed
jest --coveragefailing whendd-tracewas enabled. The root cause was our Jest hook sanitizingtestEnvironmentOptionsby creating a new object, which can break downstream transformers that rely on the original object identity/prototype.