Skip to content

test(ws,browser): add test suites for ws and browser packages#22

Merged
taigrr merged 1 commit into
masterfrom
cd/ws-tests-and-improvements
Mar 8, 2026
Merged

test(ws,browser): add test suites for ws and browser packages#22
taigrr merged 1 commit into
masterfrom
cd/ws-tests-and-improvements

Conversation

@taigrr
Copy link
Copy Markdown
Owner

@taigrr taigrr commented Mar 7, 2026

Changes

  • Added ws/server_test.go: tests for WebSocket connections, namespace filtering via query params, non-upgrade request rejection, and SetUpgrader
  • Added ws/namespaces_test.go: tests for NamespacesHandler response format and namespace registration
  • Added browser/browser_test.go: tests for HTML template rendering, WebSocket URL construction (scheme, host, path), and trailing slash handling
  • Fixed goimports whitespace in ws/server.go

Previously the ws and browser packages had 0% test coverage. This brings both to a solid baseline.

Testing

go test -race ./...

All tests pass.

- Add ws/server_test.go: WebSocket connection, namespace filtering, non-upgrade rejection, SetUpgrader
- Add ws/namespaces_test.go: NamespacesHandler response format and content
- Add browser/browser_test.go: template rendering, ws URL construction, trailing slash handling
- Fix goimports whitespace in ws/server.go
@taigrr taigrr merged commit 70ade62 into master Mar 8, 2026
2 checks passed
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.

1 participant