Skip to content

Conversation

@cruzz77
Copy link
Contributor

@cruzz77 cruzz77 commented Nov 23, 2025

This PR updates test/parallel/test-http-set-trailers.js to align with the recent test modernization work happening across the Node.js codebase. Maintainers have been gradually replacing older assert.ok(/regex/.test(...)) patterns with clearer, more explicit helpers such as assert.match() and assert.doesNotMatch().
This PR applies that same modernization to this test file.

What was changed

HTTP/1.0 test

Previously:

assert.ok(!/x-foo/.test(res_buffer));

Updated to:

assert.doesNotMatch(res_buffer, /x-foo/);

HTTP/1.1 test

Previously:

assert.ok(/0\r\nx-foo: bar\r\n\r\n$/.test(res_buffer));

Updated to:

assert.match(res_buffer, /0\r\nx-foo: bar\r\n\r\n$/);

Why this change

  • Improves readability by using purpose-built assertion helpers.
  • Aligns the test with modern Node.js testing conventions.
  • No functional or behavioral changes to the test . Only assertion style updates.

Additional notes

  • All tests continue to pass.
  • No logic or behavior was altered; only assertions were updated.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Nov 23, 2025
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Nov 23, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 23, 2025
@nodejs-github-bot
Copy link
Collaborator

@lpinca
Copy link
Member

lpinca commented Nov 23, 2025

  • Removes reliance on RegExp.prototype.test(), which is being phased out across the codebase.

?

@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.54%. Comparing base (7fe8085) to head (ff496e9).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #60831   +/-   ##
=======================================
  Coverage   88.54%   88.54%           
=======================================
  Files         703      703           
  Lines      208259   208259           
  Branches    40170    40167    -3     
=======================================
+ Hits       184405   184406    +1     
- Misses      15859    15870   +11     
+ Partials     7995     7983   -12     

see 30 files with indirect coverage changes

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

@cruzz77
Copy link
Contributor Author

cruzz77 commented Nov 23, 2025

@lpinca Thanks for pointing that out .
I meant that many recent test modernisations replace .test() with
assert.match() / assert.doesNotMatch() for clarity.

I've removed that line to avoid implying any official deprecation.
Thank you!

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 23, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 25, 2025
@nodejs-github-bot nodejs-github-bot merged commit 23c58f0 into nodejs:main Nov 25, 2025
79 of 81 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 23c58f0

targos pushed a commit that referenced this pull request Nov 27, 2025
PR-URL: #60831
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants