Skip to content

test(profiling): replace RegExp.escape with includes check - #8058

Merged
szegedi merged 1 commit into
masterfrom
BridgeAR/test-profiling-config-includes
Apr 22, 2026
Merged

test(profiling): replace RegExp.escape with includes check#8058
szegedi merged 1 commit into
masterfrom
BridgeAR/test-profiling-config-includes

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

RegExp.escape is a very recent TC39 addition (stage-4 in 2024) and is not available on Node.js 18, which this repo still supports. The existing assert.match(..., new RegExp(RegExp.escape(warning))) would crash with a TypeError: RegExp.escape is not a function on the oldest supported runtime.

Since the assertion only needed to confirm the joined warnings include a literal substring, swap it for assert.ok(joined.includes(warning)) with a descriptive failure message. No pattern matching required, no polyfill added, and the test now works on every supported Node.js version.

`RegExp.escape` is a very recent TC39 addition (stage-4 in 2024) and
is not available on Node.js 18, which this repo still supports. The
existing `assert.match(..., new RegExp(RegExp.escape(warning)))`
would crash with a `TypeError: RegExp.escape is not a function` on
the oldest supported runtime.

Since the assertion only needed to confirm the joined warnings include
a literal substring, swap it for `assert.ok(joined.includes(warning))`
with a descriptive failure message. No pattern matching required, no
polyfill added, and the test now works on every supported Node.js
version.
@BridgeAR
BridgeAR requested a review from a team as a code owner April 22, 2026 13:12
@github-actions

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 5.54 MB
Deduped: 6.39 MB
No deduping: 6.39 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@codecov

codecov Bot commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.66%. Comparing base (21db68a) to head (a2794a5).
⚠️ Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8058      +/-   ##
==========================================
+ Coverage   73.60%   73.66%   +0.05%     
==========================================
  Files         773      776       +3     
  Lines       36088    36242     +154     
==========================================
+ Hits        26562    26696     +134     
- Misses       9526     9546      +20     
Flag Coverage Δ
aiguard-macos 36.59% <ø> (-0.04%) ⬇️
aiguard-ubuntu 36.70% <ø> (-0.04%) ⬇️
aiguard-windows 36.50% <ø> (-0.04%) ⬇️
apm-capabilities-tracing-macos 48.35% <ø> (+0.17%) ⬆️
apm-capabilities-tracing-ubuntu 48.41% <ø> (+0.20%) ⬆️
apm-capabilities-tracing-windows 48.17% <ø> (+0.17%) ⬆️
apm-integrations-child-process 36.18% <ø> (-0.08%) ⬇️
apm-integrations-couchbase-18 35.17% <ø> (-0.10%) ⬇️
apm-integrations-couchbase-eol 35.25% <ø> (-0.07%) ⬇️
apm-integrations-oracledb 35.22% <ø> (-0.07%) ⬇️
appsec-express 52.90% <ø> (-0.07%) ⬇️
appsec-fastify 49.38% <ø> (-0.06%) ⬇️
appsec-graphql 49.65% <ø> (-0.16%) ⬇️
appsec-kafka 42.18% <ø> (-0.08%) ⬇️
appsec-ldapjs 41.50% <ø> (-0.07%) ⬇️
appsec-lodash 41.52% <ø> (-0.07%) ⬇️
appsec-macos 56.82% <ø> (-0.07%) ⬇️
appsec-mongodb-core 45.83% <ø> (-0.39%) ⬇️
appsec-mongoose 46.72% <ø> (-0.07%) ⬇️
appsec-mysql 48.87% <ø> (-0.06%) ⬇️
appsec-node-serialize 40.70% <ø> (-0.07%) ⬇️
appsec-passport 44.69% <ø> (-0.07%) ⬇️
appsec-postgres 48.44% <ø> (-0.09%) ⬇️
appsec-sourcing 40.19% <ø> (-0.07%) ⬇️
appsec-stripe 42.42% <ø> (-0.07%) ⬇️
appsec-template 40.86% <ø> (-0.07%) ⬇️
appsec-ubuntu 56.90% <ø> (-0.07%) ⬇️
appsec-windows 56.72% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-bluebird 29.87% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-body-parser 37.77% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-child_process 35.56% <ø> (-0.08%) ⬇️
instrumentations-instrumentation-cookie-parser 31.80% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-express 32.01% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 31.92% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-express-session 37.40% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-fs 29.54% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-generic-pool 30.92% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-http 37.01% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-knex 29.84% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-mongoose 30.95% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-multer 37.55% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-mysql2 35.53% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-passport 41.28% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-passport-http 40.97% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-passport-local 41.47% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-pg 35.05% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-promise 29.81% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-promise-js 29.81% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-q 29.84% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-url 29.80% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-when 29.83% <ø> (-0.07%) ⬇️
llmobs-ai 38.49% <ø> (-0.07%) ⬇️
llmobs-anthropic 37.94% <ø> (-0.07%) ⬇️
llmobs-bedrock 37.19% <ø> (-0.06%) ⬇️
llmobs-google-genai 37.62% <ø> (-0.07%) ⬇️
llmobs-langchain 37.06% <ø> (-0.16%) ⬇️
llmobs-openai 41.31% <ø> (-0.07%) ⬇️
llmobs-vertex-ai 37.79% <ø> (-0.07%) ⬇️
platform-core 30.01% <ø> (ø)
platform-esbuild 32.83% <ø> (ø)
platform-instrumentations-misc 40.09% <ø> (-0.15%) ⬇️
platform-shimmer 35.73% <ø> (ø)
platform-unit-guardrails 31.38% <ø> (ø)
platform-webpack 20.78% <ø> (-0.06%) ⬇️
plugins-azure-durable-functions 25.21% <ø> (ø)
plugins-azure-event-hubs 25.36% <ø> (ø)
plugins-azure-service-bus 24.78% <ø> (ø)
plugins-bullmq 40.83% <ø> (-0.08%) ⬇️
plugins-cassandra 35.36% <ø> (-0.07%) ⬇️
plugins-cookie 26.33% <ø> (ø)
plugins-cookie-parser 26.14% <ø> (ø)
plugins-crypto 25.66% <ø> (ø)
plugins-dd-trace-api 35.49% <ø> (-0.08%) ⬇️
plugins-express-mongo-sanitize 26.28% <ø> (ø)
plugins-express-session 26.10% <ø> (ø)
plugins-fastify 39.46% <ø> (-0.07%) ⬇️
plugins-fetch 35.87% <ø> (-0.07%) ⬇️
plugins-fs 35.78% <ø> (-0.08%) ⬇️
plugins-generic-pool 25.25% <ø> (ø)
plugins-google-cloud-pubsub 43.13% <ø> (-0.07%) ⬇️
plugins-grpc 38.14% <ø> (-0.07%) ⬇️
plugins-handlebars 26.32% <ø> (ø)
plugins-hapi 37.37% <ø> (-0.07%) ⬇️
plugins-hono 37.62% <ø> (-0.07%) ⬇️
plugins-ioredis 35.82% <ø> (-0.07%) ⬇️
plugins-knex 26.01% <ø> (ø)
plugins-langgraph 35.17% <ø> (-0.07%) ⬇️
plugins-ldapjs 23.88% <ø> (ø)
plugins-light-my-request 25.75% <ø> (ø)
plugins-limitd-client 30.09% <ø> (-0.07%) ⬇️
plugins-lodash 25.33% <ø> (ø)
plugins-mariadb 36.74% <ø> (-0.03%) ⬇️
plugins-memcached 35.46% <ø> (-0.08%) ⬇️
plugins-microgateway-core 36.46% <ø> (-0.07%) ⬇️
plugins-moleculer 38.16% <ø> (-0.07%) ⬇️
plugins-mongodb 36.56% <ø> (-0.07%) ⬇️
plugins-mongodb-core 36.31% <ø> (-0.05%) ⬇️
plugins-mongoose 36.14% <ø> (-0.15%) ⬇️
plugins-multer 26.10% <ø> (ø)
plugins-mysql 36.55% <ø> (-0.08%) ⬇️
plugins-mysql2 36.53% <ø> (-0.07%) ⬇️
plugins-node-serialize 26.37% <ø> (ø)
plugins-opensearch 35.12% <ø> (-0.07%) ⬇️
plugins-passport-http 26.16% <ø> (ø)
plugins-postgres 34.51% <ø> (-0.07%) ⬇️
plugins-process 25.66% <ø> (ø)
plugins-pug 26.33% <ø> (ø)
plugins-redis 36.02% <ø> (-0.07%) ⬇️
plugins-router 40.03% <ø> (-0.07%) ⬇️
plugins-sequelize 25.03% <ø> (ø)
plugins-test-and-upstream-amqp10 35.79% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-amqplib 40.97% <ø> (-0.08%) ⬇️
plugins-test-and-upstream-apollo 36.64% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-avsc 35.63% <ø> (-0.08%) ⬇️
plugins-test-and-upstream-bunyan 31.24% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-connect 37.97% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-graphql 37.32% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-koa 37.57% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-protobufjs 35.85% <ø> (-0.08%) ⬇️
plugins-test-and-upstream-rhea 41.08% <ø> (-0.08%) ⬇️
plugins-undici 36.64% <ø> (-0.07%) ⬇️
plugins-url 25.66% <ø> (ø)
plugins-valkey 35.49% <ø> (-0.08%) ⬇️
plugins-vm 25.66% <ø> (ø)
plugins-winston 31.67% <ø> (-0.07%) ⬇️
plugins-ws 39.09% <ø> (-0.07%) ⬇️
profiling-macos 38.05% <ø> (-0.07%) ⬇️
profiling-ubuntu 38.21% <ø> (-0.53%) ⬇️
profiling-windows 39.57% <ø> (-0.07%) ⬇️
serverless-azure-functions-client 25.10% <ø> (ø)
serverless-azure-functions-eventhubs 25.10% <ø> (ø)
serverless-azure-functions-servicebus 25.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Apr 22, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 68.02% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a2794a5 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Apr 22, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-22 13:22:02

Comparing candidate commit a2794a5 in PR branch BridgeAR/test-profiling-config-includes with baseline commit 21db68a in branch master.

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

@szegedi
szegedi merged commit 237e32c into master Apr 22, 2026
901 of 903 checks passed
@szegedi
szegedi deleted the BridgeAR/test-profiling-config-includes branch April 22, 2026 14:16
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Apr 23, 2026
BridgeAR added a commit that referenced this pull request Apr 30, 2026
`RegExp.escape` is a very recent TC39 addition (stage-4 in 2024) and
is not available on Node.js 18, which this repo still supports. The
existing `assert.match(..., new RegExp(RegExp.escape(warning)))`
would crash with a `TypeError: RegExp.escape is not a function` on
the oldest supported runtime.

Since the assertion only needed to confirm the joined warnings include
a literal substring, swap it for `assert.ok(joined.includes(warning))`
with a descriptive failure message. No pattern matching required, no
polyfill added, and the test now works on every supported Node.js
version.
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