Skip to content

test: completely remove chai and fix type errors - #7144

Merged
BridgeAR merged 5 commits into
masterfrom
BridgeAR/2025-12-18-fix-type-issues
Dec 22, 2025
Merged

test: completely remove chai and fix type errors#7144
BridgeAR merged 5 commits into
masterfrom
BridgeAR/2025-12-18-fix-type-issues

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 4.36 MB
Deduped: 5.18 MB
No deduping: 5.18 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@BridgeAR
BridgeAR changed the base branch from master to BridgeAR/2025-12-18-rewrite-chai-to-assert December 18, 2025 18:51
@codecov

codecov Bot commented Dec 18, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.77%. Comparing base (261e8ec) to head (8f35575).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7144   +/-   ##
=======================================
  Coverage   84.77%   84.77%           
=======================================
  Files         522      522           
  Lines       22232    22233    +1     
=======================================
+ Hits        18848    18849    +1     
  Misses       3384     3384           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from BridgeAR/2025-12-18-rewrite-chai-to-assert to master December 18, 2025 19:00
@BridgeAR
BridgeAR force-pushed the BridgeAR/2025-12-18-fix-type-issues branch from 783ea14 to 18a1a0e Compare December 18, 2025 19:21
@pr-commenter

pr-commenter Bot commented Dec 18, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-12-20 01:34:58

Comparing candidate commit 8f35575 in PR branch BridgeAR/2025-12-18-fix-type-issues with baseline commit 261e8ec in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 288 metrics, 32 unstable metrics.

@BridgeAR
BridgeAR force-pushed the BridgeAR/2025-12-18-fix-type-issues branch from 3094a62 to 3012057 Compare December 19, 2025 17:39
@BridgeAR BridgeAR changed the title test: fix env type errors test: completely remove chai and fix type errors Dec 19, 2025
@BridgeAR
BridgeAR marked this pull request as ready for review December 19, 2025 17:40
@BridgeAR
BridgeAR requested review from a team as code owners December 19, 2025 17:40
@BridgeAR
BridgeAR requested review from khanayan123 and removed request for a team December 19, 2025 17:40
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Dec 19, 2025

Copy link
Copy Markdown

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1 Test failed

esbuild support for IAST cjs "before all" hook in "cjs" from cjs (Datadog) (Fix with Cursor)
Command failed: npm install || npm install

Error: Command failed: npm install || npm install

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1104:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8f35575 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

watson
watson previously approved these changes Dec 19, 2025
// This is a bit like chai's `expect(expected).to.deep.include(actual)`, except
// that when it recurses it uses the same inclusion check, rather than deep
// equality. Some nice output is included.
function deepInclude (expected, actual, path = []) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! Great to get rid of this redundant code. It was even exported but just not used (anymore at least)

// OpenTracing's upstream API compatibility checks depend on `chai`, but this
// repo intentionally does not. We provide a minimal shim just for these checks
// (assert.equal, expect(...).to.not.throw(), expect(...).to.be.a()).
function createChaiShim () {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice hack 😂

Environment variables may only be of type string or undefined.
Instead, the code is now using Node.js assert or a native testing
library available by a test runner.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2025-12-18-fix-type-issues branch from fe70f24 to ace957f Compare December 19, 2025 21:49
Comment thread packages/datadog-plugin-ws/test/index.spec.js
Comment thread packages/datadog-plugin-ws/test/index.spec.js Outdated
@BridgeAR
BridgeAR merged commit dac1ec5 into master Dec 22, 2025
1056 of 1067 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2025-12-18-fix-type-issues branch December 22, 2025 11:12
dd-octo-sts Bot pushed a commit that referenced this pull request Jan 12, 2026
* test: fix env type errors

Environment variables may only be of type string or undefined.

* test: remove all chai related code

Instead, the code is now using Node.js assert or a native testing
library available by a test runner.

* test: fix opentracing tests

This uses a hack to keep them supported, since they use chai. To do so,
a fake chai is introduced when loading that test file.

* test: remove unused deepInclude test helper

It was not used for a while and could be replaced with the more
generic partial deep strict equal helper.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jan 12, 2026
nina9753 pushed a commit that referenced this pull request Jan 15, 2026
* test: fix env type errors

Environment variables may only be of type string or undefined.

* test: remove all chai related code

Instead, the code is now using Node.js assert or a native testing
library available by a test runner.

* test: fix opentracing tests

This uses a hack to keep them supported, since they use chai. To do so,
a fake chai is introduced when loading that test file.

* test: remove unused deepInclude test helper

It was not used for a while and could be replaced with the more
generic partial deep strict equal helper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants