Skip to content

test(ws): on error event with unreachable websocket target - #1243

Merged
chimurai merged 1 commit into
masterfrom
test-unreachable-websocket-target
May 23, 2026
Merged

chimurai merged 1 commit into
masterfrom
test-unreachable-websocket-target

Conversation

@chimurai

@chimurai chimurai commented May 23, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • Tests
    • Enhanced test coverage for websocket proxy error handling scenarios, validating behavior when upstream target is unreachable.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 23, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6167cea8-43d7-42d9-ae3f-9966a7bcf395

📥 Commits

Reviewing files that changed from the base of the PR and between 899c507 and 32583e5.

📒 Files selected for processing (1)
  • test/e2e/websocket.spec.ts

📝 Walkthrough

Walkthrough

This pull request adds a single E2E test suite that validates websocket proxy error handling. The test verifies that when a websocket client connects to a proxy configured with an unreachable upstream target, the middleware's error callback is invoked with the correct error, request URL, and socket parameters.

Changes

WebSocket Proxy Error Handling

Layer / File(s) Summary
Unreachable target error callback test
test/e2e/websocket.spec.ts
New test suite with unreachable websocket target validates that the proxy's on.error handler is called exactly once with a truthy error, the expected /socket request URL, and a non-null socket argument when connecting to an unreachable websocket upstream.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A websocket test hops into view,
Where unreachable targets meet handlers true,
Error callbacks dance in the proxy light,
Socket cleanup keeps the flow just right!
Hop, hop, test complete! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an E2E test for websocket error handling with an unreachable target.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test-unreachable-websocket-target

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented May 23, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/http-proxy-middleware@1243

commit: 32583e5

@coveralls

coveralls commented May 23, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 94.67%. remained the same — test-unreachable-websocket-target into master

@chimurai
chimurai merged commit bb3bf76 into master May 23, 2026
31 of 33 checks passed
@chimurai
chimurai deleted the test-unreachable-websocket-target branch May 23, 2026 17:10
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