test: use partialDeepStrictEqual instead of individual assertions#7133
test: use partialDeepStrictEqual instead of individual assertions#7133
Conversation
This makes the test output in case of errors easier to understand as well as making the code easier to read.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7133 +/- ##
==========================================
- Coverage 84.79% 84.10% -0.70%
==========================================
Files 521 514 -7
Lines 22159 21995 -164
==========================================
- Hits 18790 18498 -292
- Misses 3369 3497 +128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Overall package sizeSelf size: 4.35 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 1.15.0 | 127.66 kB | 856.24 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2025-12-18 01:57:32 Comparing candidate commit f1a0543 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 292 metrics, 28 unstable metrics. |
|
@BridgeAR did you review yourself carefully every line of the diff to make sure the output of the AI is correct and functionally equivalent to the original ? |
| const envVar = { DD_TRACE_AZURE_EVENTHUBS_BATCH_LINKS_ENABLED: false, ...spawnEnv } | ||
| proc = await spawnPluginIntegrationTestProc(sandboxCwd(), 'server.mjs', agent.port, undefined, envVar) | ||
| const envVar = { DD_TRACE_AZURE_EVENTHUBS_BATCH_LINKS_ENABLED: 'false', ...spawnEnv } | ||
| proc = await spawnPluginIntegrationTestProc(sandboxCwd(), 'server.mjs', agent.port, envVar) |
There was a problem hiding this comment.
Envs are always converted to a string when being assigned. It is a magic setter.
undefined was fine due to the overloading happening in the method.
| assertObjectContains(traces[0][0].meta, { | ||
| '_dd.dbm_trace_injected': 'true' | ||
| }) |
There was a problem hiding this comment.
Nit: This one could be reverted. Maybe there's similar situations in the files above that I missed. Consider validating
|
@simon-id I quickly went through all changes and I could not identify any wrong change. That should also easily show up in test failures (besides lacking new entries) |
This makes the test output in case of errors easier to understand as well as making the code easier to read.
The diff is big while it should be easy to review.
The code change was done with an AI, concentrating solely on this migration in files with most offenders.