Skip to content

test: support nock v14#675

Merged
NguyenHoangSon96 merged 6 commits intomainfrom
test/support-nock-v14
Jan 23, 2026
Merged

test: support nock v14#675
NguyenHoangSon96 merged 6 commits intomainfrom
test/support-nock-v14

Conversation

@NguyenHoangSon96
Copy link
Contributor

@NguyenHoangSon96 NguyenHoangSon96 commented Jan 20, 2026

Closes PR

Proposed Changes

  • Move test cases that use events from NodeHttpTransport.test to e2e.test and use the real NodeJS HTTP module, so the event will be more consistent (Nock does not work like the 100% http module, it just mimics some behavior).
  • Move the communicates through a proxy test case to use the real HTTP module because Nock has changed the way they handle the url so the previous test case failed.
  • Make this test casefails on write response status not being 2xx use a valid response status, previous 100 status were not allowed by Nock.
  • Use req.destroy() and res.destroy() functions instead of emit('error'), base all new suggestions on Nodejs document page Document.

It's hard to know which events will be emitted from Nodejs, these new events and test cases are just based on my trial and errors method.

There is a linter error because we updated github/super-linter from v5 to v7; this needs a separate PR to fix the new github/super-linter asks, so please ignore it in this PR.

Screenshot 2026-01-21 at 13 17 00

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@NguyenHoangSon96 NguyenHoangSon96 self-assigned this Jan 20, 2026
@NguyenHoangSon96 NguyenHoangSon96 marked this pull request as ready for review January 20, 2026 11:47
@NguyenHoangSon96 NguyenHoangSon96 force-pushed the test/support-nock-v14 branch 2 times, most recently from 2312f8c to 410bb85 Compare January 21, 2026 06:23
@NguyenHoangSon96 NguyenHoangSon96 requested review from bednar, Copilot, karel-rehor and vlastahajek and removed request for Copilot January 21, 2026 06:28
Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

It looks good, just small requirement:

Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Please merge PR after the CI checks pass.

@NguyenHoangSon96 NguyenHoangSon96 force-pushed the test/support-nock-v14 branch 2 times, most recently from 371566f to 96ce3ef Compare January 23, 2026 07:09
@NguyenHoangSon96 NguyenHoangSon96 merged commit f94155c into main Jan 23, 2026
14 checks passed
@NguyenHoangSon96 NguyenHoangSon96 deleted the test/support-nock-v14 branch January 23, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants