Skip to content

test(ws): add tests docs - #1238

Merged
chimurai merged 1 commit into
masterfrom
add-websocket-tests-docs
May 23, 2026
Merged

test(ws): add tests docs#1238
chimurai merged 1 commit into
masterfrom
add-websocket-tests-docs

Conversation

@chimurai

@chimurai chimurai commented May 23, 2026

Copy link
Copy Markdown
Owner

related: #463

Summary by CodeRabbit

  • Documentation

    • Enhanced WebSocket documentation with clearer guidance on configuration options and alternative implementation approaches.
    • Added comprehensive examples for WebSocket path handling and multiple target scenarios.
    • Improved cross-references between documentation sections.
  • Tests

    • Expanded WebSocket end-to-end test coverage for path-based proxying and multiple target scenarios.

Review Change Stack

- add ws test when mounted with a custom path
- add ws test when mounted with a custom path and multiple ws targets
- improve documentation for different ws usage
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR enhances WebSocket documentation and test coverage. The recipes/websocket.md file receives substantial updates including a table of contents, clarified guidance on ws: true requirements, reworked upgrade subscription examples, and a new section on multiple WebSocket targets. The README is updated to reference this improved recipe. E2E tests are added to validate mounted path forwarding and multi-route WebSocket proxying.

Changes

WebSocket Documentation and Test Coverage

Layer / File(s) Summary
WebSocket recipe documentation improvements
recipes/websocket.md
Table of contents and ws: true clarification added. Manual server upgrade subscription example reworked to show pathFilter configuration. New "Multiple WebSocket targets" section demonstrates mounting separate proxies on different routes. Path rewrite example consolidated into options object pattern with ws, pathFilter, and pathRewrite.
README reference and E2E test coverage
README.md, test/e2e/websocket.spec.ts
README WebSocket section gains pointer to enhanced recipes. E2E test suite imports createAppWithPath and adds two test cases: one validates mounted /ws-path forwarding without path segment duplication; another validates distinct routing and messages for separately mounted /ws-path-a and /ws-path-b proxies with per-middleware pathFilter scoping.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 WebSocket paths are now crystal clear,
With docs that guide both far and near,
Multiple targets dance in place,
While tests ensure each finds its trace—
Hop along, the docs now soar!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'test(ws): add tests docs' is vague and ambiguous, using generic phrasing that doesn't clearly convey what changes are being made. Clarify the title to be more specific about the actual changes, such as 'test(ws): add WebSocket path and multi-target tests' or 'docs(ws): improve WebSocket documentation with examples'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 add-websocket-tests-docs

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@1238

commit: 784c36d

@chimurai
chimurai merged commit eb35a22 into master May 23, 2026
24 of 25 checks passed
@chimurai
chimurai deleted the add-websocket-tests-docs branch May 23, 2026 12:15
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 94.67%. remained the same — add-websocket-tests-docs into master

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